-
Notifications
You must be signed in to change notification settings - Fork 375
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(analytics): move feature_name index into its own migration file (#…
- Loading branch information
1 parent
d63a289
commit 39b7300
Showing
2 changed files
with
37 additions
and
17 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
32 changes: 32 additions & 0 deletions
32
api/app_analytics/migrations/0003_add_feature_name_index.py
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,32 @@ | ||
# Generated by Django 3.2.23 on 2024-02-15 18:33 | ||
|
||
from django.db import migrations, models | ||
|
||
from core.migration_helpers import PostgresOnlyRunSQL | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
atomic = False | ||
|
||
dependencies = [ | ||
("app_analytics", "0002_featureevaluationraw_identifier_and_index_feature"), | ||
] | ||
|
||
operations = [ | ||
migrations.SeparateDatabaseAndState( | ||
state_operations=[ | ||
migrations.AlterField( | ||
model_name="featureevaluationraw", | ||
name="feature_name", | ||
field=models.CharField(db_index=True, max_length=2000), | ||
), | ||
], | ||
database_operations=[ | ||
PostgresOnlyRunSQL( | ||
'CREATE INDEX CONCURRENTLY IF NOT EXISTS "app_analytics_featureevaluationraw_feature_name_idx" ON "app_analytics_featureevaluationraw" ("feature_name");', | ||
reverse_sql='DROP INDEX CONCURRENTLY IF EXISTS "app_analytics_featureevaluationraw_feature_name_idx";', | ||
) | ||
], | ||
), | ||
] |