Skip to content

Commit

Permalink
Added database_operations for up/down index concurrently
Browse files Browse the repository at this point in the history
  • Loading branch information
memclutter committed Nov 13, 2022
1 parent 10f8c74 commit 4e85b82
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ class Migration(migrations.Migration):
model_name='question',
index=models.Index(fields=['-pub_date'], name='polls_quest_pub_dat_ca81de_idx'),
),
],
database_operations=[
migrations.RunSQL(
sql='CREATE INDEX CONCURRENTLY polls_quest_pub_dat_ca81de_idx ON polls_question(pub_date DESC)',
reverse_sql='DROP INDEX polls_quest_pub_dat_ca81de_idx',
)
]
),
]

0 comments on commit 4e85b82

Please sign in to comment.