Skip to content
Snippets Groups Projects
Unverified Commit b76e26fa authored by John Swanson's avatar John Swanson Committed by GitHub
Browse files

Correct type for `report_card.collection_preview` (#42919)

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, `GET`ting a card results in a
boolean `"collection_preview"`.
parent f436b5b0
No related branches found
No related tags found
No related merge requests found
......@@ -7335,6 +7335,57 @@ databaseChangeLog:
- customChange:
class: "metabase.db.custom_migrations.MigrateMetricsToV2"
- changeSet:
id: v51.2024-05-20T19:10:34
author: johnswanson
comment: >-
Modify type of report_card.collection_preview to ${boolean.type} on mysql,mariadb
dbms: mysql,mariadb
changes:
- modifyDataType:
tableName: report_card
columnName: collection_preview
newDataType: ${boolean.type}
rollback:
- modifyDataType:
tableName: report_card
columnName: collection_preview
newDataType: boolean
defaultValueBoolean: true
preConditions:
- onFail: MARK_RAN
- dbms:
type: mysql,mariadb
- changeSet:
id: v51.2024-05-20T20:37:55
author: johnswanson
comment: Add NOT NULL constraint to report_card.collection_preview
changes:
- addNotNullConstraint:
columnDataType: ${boolean.type}
tableName: report_card
columnName: collection_preview
defaultNullValue: true
preConditions:
- onFail: MARK_RAN
- dbms:
type: mysql,mariadb
- changeSet:
id: v51.2024-05-20T20:38:34
author: johnswanson
comment: Add default value to report_card.collection_preview
changes:
- addDefaultValue:
defaultValueBoolean: true
tableName: report_card
columnName: collection_preview
preConditions:
- onFail: MARK_RAN
- dbms:
type: mysql,mariadb
# >>>>>>>>>> DO NOT ADD NEW MIGRATIONS BELOW THIS LINE! ADD THEM ABOVE <<<<<<<<<<
########################################################################################################################
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment