Skip to content
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

[Backport v50] Correct type for report_card.collection_preview #42922

Merged
merged 1 commit into from
May 21, 2024

Conversation

johnswanson
Copy link
Contributor

@johnswanson johnswanson commented May 20, 2024

In v49, we converted all boolean types to bit(1) on mysql/mariadb. It looks like we missed this one, so when you GET a card it has "collection_preview": 1. Then we get an error when trying to save, because collection_preview should be a boolean.

I verified that after this migration, GETting a card results in a boolean "collection_preview".

Backports #42919 / fixes #40600

@metabase-bot metabase-bot bot added the .Team/AdminWebapp Admin and Webapp team label May 20, 2024
Copy link

replay-io bot commented May 20, 2024

Status Complete ↗︎
Commit f535468
Results
⚠️ 4 Flaky
2522 Passed

@johnswanson johnswanson requested a review from a team May 20, 2024 22:18
This is a bit painful. I merged this change, but realized we need to
backport the fix to v49. However:

- we don't want to have two versions of the migration (one with a v49
id, one with a v50 id) because then if someone upgrades to 50, then
downgrades to 49, the `rollback` will run and change the type back,
leading to a bug.

- we don't want to push a v51 changeSet ID to v49 or v50, because we
give the user a helpful notice when their database needs a downgrade.
We do this by checking for the latest *executed* migration in the
database and comparing it to the latest migration that Liquibase knows
about, and making sure the executed isn't bigger than the known (e.g.
you can't have executed a v51 migration if it isn't in the local
migration yaml). That would all work fine, except that then we want to
tell you how to downgrade your database, and we use the latest-executed
version for that. So if, for example, someone upgraded from 48 to 49 and
got a v51 changeset, then downgraded back to 48, they would get an error
telling them to run the *v51* jar to roll back their DB.

In this case though, I think it's fine to just move the migration around
to v49, then we can backport it to 49 and 50.
@johnswanson johnswanson enabled auto-merge (squash) May 21, 2024 14:23
@johnswanson johnswanson merged commit 8dfe015 into release-x.50.x May 21, 2024
106 checks passed
@johnswanson johnswanson deleted the jds/fix-mariadb-boolean-v50 branch May 21, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Team/AdminWebapp Admin and Webapp team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants