-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: change unique idx on messsaging table (#17636)
* change unique idx on messsaging table * not atomic
- Loading branch information
1 parent
cc2c28a
commit 025ed3d
Showing
3 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 3.2.19 on 2023-09-26 18:33 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
atomic = False # Cannot create index concurrently atomically | ||
|
||
dependencies = [ | ||
("posthog", "0351_team_surveys_opt_in"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="messagingrecord", | ||
name="campaign_count", | ||
field=models.IntegerField(null=True), | ||
), | ||
migrations.RunSQL( | ||
sql=""" | ||
CREATE UNIQUE INDEX CONCURRENTLY idx_messagingrecord_unique_on_email_hash_campaign_key_campaign_count | ||
ON posthog_messagingrecord (email_hash, campaign_key, campaign_count); | ||
""", | ||
reverse_sql=""" | ||
DROP INDEX CONCURRENTLY "idx_messagingrecord_unique_on_email_hash_campaign_key_campaign_count"; | ||
""", | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters