so simple fix
gitea/wcs/pipeline/head There was a failure building this commit Details

This commit is contained in:
Pierre Ducroquet 2024-03-04 10:25:45 +01:00
parent 4e228fb3ed
commit eb175c397e
1 changed files with 4 additions and 4 deletions

View File

@ -1745,10 +1745,6 @@ def init_search_tokens_triggers(cur):
# Instead, a weekly cron job will delete obsolete entries, thus making it sure no
# personal data is kept uselessly.
if not(_table_exists(cur, 'wcs_search_tokens')):
# abort trigger creation if tokens table doesn't exist yet
return
# First part: the appending function
cur.execute("""CREATE OR REPLACE FUNCTION wcs_search_tokens_trigger_fn ()
RETURNS trigger
@ -1760,6 +1756,10 @@ BEGIN
END;
$function$;""")
if not(_table_exists(cur, 'wcs_search_tokens')):
# abort trigger creation if tokens table doesn't exist yet
return
if _table_exists(cur, 'wcs_all_forms') and not _trigger_exists(cur, 'wcs_all_forms', 'wcs_all_forms_fts_trg_upd'):
# Second part: insert and update triggers for wcs_all_forms
cur.execute("CREATE TRIGGER wcs_all_forms_fts_trg_ins AFTER INSERT ON wcs_all_forms FOR EACH ROW WHEN (NEW.fts IS NOT NULL) EXECUTE PROCEDURE wcs_search_tokens_trigger_fn();")