-
- Downloads
Fixed width dashboard migration (#38247)
* Migration adding 'width' to Dashboards 3 migrations: - 1st adding the width column with default value of 'fixed' - 2nd updating all existing dashboards to have width 'full', which corresponds to what the current behaviour is (will be the 'old' behaviour after the fixed-width project lands). - The rolloback here is necessary but we don't care what happens as the column will be dropped immediately in the next rollback anyway - 3rd sets the notNullableConstraint. DefaultNull is 'full' here, just in case there's an existing dashboard whose width value is not yet set from the 1st migration. Don't know how that could happen, but its here in case * Dashboard PUT api endpoint accepts width changes and updates appdb update-dashboard function now is aware of the :width key so those changes can end up in the transaction. Also added a width test that asserts that the value's default is "fixed", it can be changed, eg. to "full", but cannot be changed to other values. * Add width to revision tests * Fix dashboard revision tests. :width key is now needed in some revision tests. As well we need a string communicating that the :width setting has changed from 'full' to 'fixed' or vice-versa. * Fix comments/remarks in migration to be accurate * Attempt to fix default not working mysql/mariadb * Set default in dashboard model Signed-off-by:Adam James <adam.vermeer2@gmail.com> * Revert default :width 'fixed' value. * Explicitly add default value 'fixed' for MySQL/MariaDB --------- Signed-off-by:
Adam James <adam.vermeer2@gmail.com>
Showing
- resources/migrations/001_update_migrations.yaml 53 additions, 0 deletionsresources/migrations/001_update_migrations.yaml
- src/metabase/api/dashboard.clj 4 additions, 3 deletionssrc/metabase/api/dashboard.clj
- src/metabase/models/revision/diff.clj 3 additions, 0 deletionssrc/metabase/models/revision/diff.clj
- test/metabase/api/dashboard_test.clj 22 additions, 0 deletionstest/metabase/api/dashboard_test.clj
- test/metabase/events/revision_test.clj 1 addition, 0 deletionstest/metabase/events/revision_test.clj
- test/metabase/models/dashboard_test.clj 8 additions, 4 deletionstest/metabase/models/dashboard_test.clj
Loading
Please register or sign in to comment