From abbd4d3146e819372ef79b49b5bae914b07439b9 Mon Sep 17 00:00:00 2001 From: Ben Best Date: Thu, 12 Oct 2023 10:43:20 -0700 Subject: [PATCH] Create sqlalchemy_searchable expressions (#6491) The required sql expressions for sqlalchemy_searchable are only created on the sqlalchemy pre_create hook. When upgrading from a previous redash version no CREATE statements may be run, so these expressions are never created. Add a migration to manually execute the sql_expressions DDL from sqlalchemy_searchable. --- ...reate_sqlalchemy_searchable_expressions.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py diff --git a/migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py b/migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py new file mode 100644 index 0000000000..46a0370392 --- /dev/null +++ b/migrations/versions/7ce5925f832b_create_sqlalchemy_searchable_expressions.py @@ -0,0 +1,25 @@ +"""create sqlalchemy_searchable expressions + +Revision ID: 7ce5925f832b +Revises: 1038c2174f5d +Create Date: 2023-09-29 16:48:29.517762 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy_searchable import sql_expressions + + +# revision identifiers, used by Alembic. +revision = '7ce5925f832b' +down_revision = '1038c2174f5d' +branch_labels = None +depends_on = None + + +def upgrade(): + op.execute(sql_expressions) + + +def downgrade(): + pass