sql: fix migration (#48970)

This commit is contained in:
Lauréline Guérin 2020-12-01 09:35:05 +01:00
parent fcd5d86ee5
commit a93dfa92b5
No known key found for this signature in database
GPG Key ID: 1FAB9B9B4F93D473
1 changed files with 3 additions and 3 deletions

View File

@ -2691,7 +2691,7 @@ def get_yearly_totals(period_start=None, period_end=None, criterias=None):
# latest migration, number + description (description is not used
# programmaticaly but will make sure git conflicts if two migrations are
# separately added with the same number)
SQL_LEVEL = (45, 'add index on formdata(status)')
SQL_LEVEL = (46, 'add index on formdata(status) - fix')
def migrate_global_views(conn, cur):
@ -2817,13 +2817,13 @@ def migrate():
# 38: extract submission_agent_id to its own column
# 41: update full text normalization
set_reindex('formdata', 'needed', conn=conn, cur=cur)
if sql_level < 36:
if sql_level < 46:
from wcs.formdef import FormDef
from wcs.carddef import CardDef
# 24: add index on evolution(formdata_id)
# 35: add indexes on formdata(receipt_time) and formdata(anonymised)
# 36: add index on formdata(user_id)
# 45: add index on formdata(status)
# 45 & 46: add index on formdata(status)
for formdef in FormDef.select() + CardDef.select():
do_formdef_indexes(formdef, created=False, conn=conn, cur=cur)
if sql_level < 32: