sql: add display id and formdef name to full-text index (#25643)

This commit is contained in:
Frédéric Péters 2018-08-17 13:45:56 +02:00
parent add1bf6738
commit 248a99f393
1 changed files with 5 additions and 3 deletions

View File

@ -1399,7 +1399,8 @@ class SqlFormData(SqlMixin, wcs.formdata.FormData):
cur.execute(sql_statement, sql_dict)
evo._sql_id = cur.fetchone()[0]
fts_strings = [str(self.id)]
fts_strings = [str(self.id), self.get_display_id()]
fts_strings.append(self._formdef.name)
if self.tracking_code:
fts_strings.append(self.tracking_code)
for field in self._formdef.get_all_fields():
@ -2141,7 +2142,7 @@ def get_yearly_totals(period_start=None, period_end=None, criterias=None):
return result
SQL_LEVEL = 27
SQL_LEVEL = 28
def migrate_global_views(conn, cur):
cur.execute('''SELECT COUNT(*) FROM information_schema.tables
@ -2243,11 +2244,12 @@ def migrate():
# 21: (second part), store ascii_name of users
# 23: (first part), use misc.simplify() over full text queries
set_reindex('user', 'needed', conn=conn, cur=cur)
if sql_level < 23:
if sql_level < 28:
# 17: store last_update_time in tables
# 18: add user name to full-text search index
# 21: (third part), add user ascii_names to full-text index
# 23: (second part) use misc.simplify() over full text queries
# 28: add display id and formdef name to full-text index
set_reindex('formdata', 'needed', conn=conn, cur=cur)
if sql_level < 24:
from wcs.formdef import FormDef