-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create sqlalchemy_searchable expressions #6491
Create sqlalchemy_searchable expressions #6491
Conversation
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.
Codecov Report
@@ Coverage Diff @@
## master #6491 +/- ##
=======================================
Coverage 61.26% 61.26%
=======================================
Files 158 158
Lines 12889 12889
Branches 1755 1755
=======================================
Hits 7896 7896
Misses 4743 4743
Partials 250 250 |
Thanks @azundo, this looks useful. I'm trying to solve a different problem this weekend (Trino related), but this shouldn't be too hard to test too anyway. |
@justinclift I was finally able to manually test it so I have at least run the migration code and confirmed it works as expected, but probably worth having someone else confirm as well. It's a bit awkward to reproduce the exact scenario of installing an older version and then upgrading. I simulated this instead by deleting all the SQL expressions created by sqlalchemy searchable so search would fail again, and then running the redash migration to confirm the fix. @eradman that issue doesn't look related to me at first glance |
Sorry for the delay in reviewing this. I have this on my ToDo list for the next few days though. It's not forgotten. 😄 |
No worries at all! The workaround I shared in the bug report is an easy fix for anyone running into this so I wouldn't say it's urgent. |
Hi! @azundo @justinclift I've tested it both on my dev server and production cluster, and everything works fine. @eradman Also tested updating to |
I tested this PR, it's work just like a charm. |
Awesome. Thanks for verifying it @Krikooo. Merging it now. 😄 |
What's the proper way to run this migration after upgrading redash? |
@pinophyta try
or if not using docker
|
Thank you very much @eradman. That worked and I was able to upgrade to latest dev tag 🥳 |
The required sql expressions for sqlalchemy_searchable are only created on the sqlalchemy pre_create hook. When upgrading from a previous redash version, there may be no CREATE statements in any applicable migrations, so these sql expressions are never created.
In a fresh install the hook runs properly so there's no issue with the search functionality.
Add a migration to manually execute the sql_expressions DDL from sqlalchemy_searchable.
What type of PR is this?
Description
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.
How is this tested?
Related Tickets & Documents
Fixes #6381