diff --git a/resources/migrations/001_update_migrations.yaml b/resources/migrations/001_update_migrations.yaml index b0454292a42feb9bc0e0f7b03d191ab4832d9830..fd17c9a93fe651fed1f08a15ac33a3d7c0e3929e 100644 --- a/resources/migrations/001_update_migrations.yaml +++ b/resources/migrations/001_update_migrations.yaml @@ -7926,6 +7926,55 @@ databaseChangeLog: - sql: "DELETE FROM ${databasechangelog.name} WHERE id = 'v50.2024-04-12T12:33:09'" rollback: # nothing to do here + - changeSet: + id: v50.2024-07-02T16:48:21 + author: adam-james + comment: Remove existing user_parameter_value entries as we want to add dashboard_id, and can't easily backfill + rollback: # none, entries already removed and are non-critical to app functionality + changes: + - delete: + tableName: user_parameter_value + + - changeSet: + id: v50.2024-07-02T16:49:29 + author: adam-james + comment: Add dashboard_id column to user_parameter_value to keep values unique per dashboard + changes: + - addColumn: + columns: + - column: + name: dashboard_id + type: int + remarks: The ID of the dashboard + tableName: user_parameter_value + + - changeSet: + id: v50.2024-07-02T16:55:42 + author: adam-james + comment: Add fk constraint to user_parameter_value.dashboard_id + changes: + - addForeignKeyConstraint: + baseTableName: user_parameter_value + baseColumnNames: dashboard_id + referencedTableName: report_dashboard + referencedColumnNames: id + constraintName: fk_user_parameter_value_dashboard_id + nullable: false + deleteCascade: true + + - changeSet: + id: v50.2024-07-02T17:07:15 + author: adam-james + comment: Index user_parameter_value.dashboard_id + rollback: # not necessary, will be removed with the table + changes: + - createIndex: + tableName: user_parameter_value + indexName: idx_user_parameter_value_dashboard_id + columns: + column: + name: dashboard_id + - changeSet: id: v51.2024-05-13T15:30:57 author: metamben @@ -8010,55 +8059,6 @@ databaseChangeLog: tableName: login_history indexName: idx_user_id_device_id - - changeSet: - id: v51.2024-07-02T16:48:21 - author: adam-james - comment: Remove existing user_parameter_value entries as we want to add dashboard_id, and can't easily backfill - rollback: # none, entries already removed and are non-critical to app functionality - changes: - - delete: - tableName: user_parameter_value - - - changeSet: - id: v51.2024-07-02T16:49:29 - author: adam-james - comment: Add dashboard_id column to user_parameter_value to keep values unique per dashboard - changes: - - addColumn: - columns: - - column: - name: dashboard_id - type: int - remarks: The ID of the dashboard - tableName: user_parameter_value - - - changeSet: - id: v51.2024-07-02T16:55:42 - author: adam-james - comment: Add fk constraint to user_parameter_value.dashboard_id - changes: - - addForeignKeyConstraint: - baseTableName: user_parameter_value - baseColumnNames: dashboard_id - referencedTableName: report_dashboard - referencedColumnNames: id - constraintName: fk_user_parameter_value_dashboard_id - nullable: false - deleteCascade: true - - - changeSet: - id: v51.2024-07-02T17:07:15 - author: adam-james - comment: Index user_parameter_value.dashboard_id - rollback: # not necessary, will be removed with the table - changes: - - createIndex: - tableName: user_parameter_value - indexName: idx_user_parameter_value_dashboard_id - columns: - column: - name: dashboard_id - # >>>>>>>>>> DO NOT ADD NEW MIGRATIONS BELOW THIS LINE! ADD THEM ABOVE <<<<<<<<<< ########################################################################################################################