Skip to content

Commit 1132203

Browse files
committed
Fixing tests
1 parent 68e356d commit 1132203

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/sentry/migrations/0416_add_actor_constraints.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,25 @@ class Migration(CheckedMigration):
4343
ALTER TABLE "sentry_actor" DROP CONSTRAINT IF EXISTS "sentry_actor_user_id_c832ff63_uniq";
4444
DROP INDEX CONCURRENTLY IF EXISTS "sentry_actor_user_id_c832ff63";
4545
DROP INDEX CONCURRENTLY IF EXISTS "sentry_actor_user_id_c832ff63_uniq";
46-
CREATE UNIQUE INDEX CONCURRENTLY "sentry_actor_user_id_c832ff63_uniq" ON "sentry_actor" ("user_id");
46+
CREATE UNIQUE INDEX CONCURRENTLY IF NOT EXISTS "sentry_actor_user_id_c832ff63_uniq" ON "sentry_actor" ("user_id");
4747
""".splitlines()
4848
if line.strip()
4949
]
5050
+ [
51+
migrations.RunSQL(
52+
sql="SELECT 1",
53+
reverse_sql="""
54+
ALTER TABLE "sentry_actor" ADD CONSTRAINT "sentry_actor_team_id_6ca8eba5_uniq" UNIQUE USING INDEX "sentry_actor_team_id_6ca8eba5_uniq";
55+
""",
56+
hints={"tables": ["sentry_actor"]},
57+
),
58+
migrations.RunSQL(
59+
sql="SELECT 1",
60+
reverse_sql="""
61+
ALTER TABLE "sentry_actor" ADD CONSTRAINT "sentry_actor_user_id_c832ff63_uniq" UNIQUE USING INDEX "sentry_actor_user_id_c832ff63_uniq";
62+
""",
63+
hints={"tables": ["sentry_actor"]},
64+
),
5165
migrations.AlterField(
5266
model_name="pagerdutyservice",
5367
name="organization_id",

0 commit comments

Comments
 (0)