2020-09-13 15:29:27 +02:00
|
|
|
from django.db import migrations
|
|
|
|
|
|
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
|
|
dependencies = [
|
2021-02-12 08:20:45 +01:00
|
|
|
("zerver", "0301_fix_unread_messages_in_deactivated_streams"),
|
2020-09-13 15:29:27 +02:00
|
|
|
]
|
|
|
|
|
|
|
|
operations = [
|
|
|
|
# We do Stream lookups case-insensitively with respect to the name, but we were missing
|
|
|
|
# the appropriate (realm_id, upper(name::text)) unique index to enforce uniqueness
|
|
|
|
# on database level.
|
2021-02-12 08:19:30 +01:00
|
|
|
migrations.RunSQL(
|
|
|
|
"""
|
2020-09-13 15:29:27 +02:00
|
|
|
CREATE UNIQUE INDEX zerver_stream_realm_id_name_uniq ON zerver_stream (realm_id, upper(name::text));
|
2021-02-12 08:19:30 +01:00
|
|
|
"""
|
|
|
|
),
|
2020-09-13 15:29:27 +02:00
|
|
|
migrations.AlterUniqueTogether(
|
2021-02-12 08:20:45 +01:00
|
|
|
name="stream",
|
2020-09-13 15:29:27 +02:00
|
|
|
unique_together=set(),
|
|
|
|
),
|
|
|
|
]
|