Projet

Général

Profil

0001-sql-run-migration-to-get-new-index-on-evolution-tabl.patch

Frédéric Péters, 01 janvier 2023 19:15

Télécharger (1,62 ko)

Voir les différences:

Subject: [PATCH] sql: run migration to get new index on evolution tables
 (#72859)

 wcs/sql.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
wcs/sql.py
4772 4772
# latest migration, number + description (description is not used
4773 4773
# programmaticaly but will make sure git conflicts if two migrations are
4774 4774
# separately added with the same number)
4775
SQL_LEVEL = (73, 'form tokens to db')
4775
SQL_LEVEL = (74, 'change evolution index to be on (fomdata_id, id)')
4776 4776

  
4777 4777

  
4778 4778
def migrate_global_views(conn, cur):
......
5008 5008
        # 61: use setweight on formdata & user indexation
5009 5009
        # 62: use setweight on formdata & user indexation (reapply)
5010 5010
        set_reindex('formdata', 'needed', conn=conn, cur=cur)
5011
    if sql_level < 56:
5011
    if sql_level < 74:
5012 5012
        from wcs.carddef import CardDef
5013 5013
        from wcs.formdef import FormDef
5014 5014

  
......
5017 5017
        # 36: add index on formdata(user_id)
5018 5018
        # 45 & 46: add index on formdata(status)
5019 5019
        # 56: add GIN indexes to concerned_roles_array and actions_roles_array
5020
        # 74: (late migration) change evolution index to be on (fomdata_id, id)
5020 5021
        for formdef in FormDef.select() + CardDef.select():
5021 5022
            do_formdef_indexes(formdef, created=False, conn=conn, cur=cur)
5022 5023
    if sql_level < 30:
5023
-