Queries table missing migration column


#1

hey Redash Team,

i got an error when creating queries on redash plateform,

Error running query: (psycopg2.ProgrammingError) column queries.search_vector does not exist LINE 1: ...ule_failures, queries.options AS queries_options, queries.se... ^

i’m using the last version of redash 4,

NS: i had also alembic.util.exc.CommandError: Can't locate revision identified by '78ebf428e6d0' but i connected to DB
and droped the alembic_version table, and run db init, and db migrate, db upgrade


#2

it seems like this revision were not applied, revision = '5ec5c84ba61e'


#3

It looks like your queries table is missing the search_vector column.

When you run db init and the tables already exist, it doesn’t touch your tables, but it does “stamp” the database version as the latest one (so further migrations won’t apply). db upgrade in this case will do nothing either as your database reports to be in the latest version and db migrate is just a utility to create new migrations.

You need to figure out which migrations your database is missing, then you have two options –

  1. Manually apply the needed changes.
  2. Update alembic_version table to the migration before the one you need, and run db upgrade.

#4

Thank You arik for your reply,

i think is missed this migration to be applied https://github.com/getredash/redash/blob/master/migrations/versions/5ec5c84ba61e_.py

  • so i need to apply this migration, could You please @arikfr show me how, i’m not familiar with flask

  • then i need to go into redash db and update alembic_version to the applied revision mean 5ec5c84ba61e