Merge branch 'cleanup-truncated-indices' into 'master'

Migration fixes for 4.3 -> 4.4

See merge request redactmanager/persistence-service!918
This commit is contained in:
Maverick Studer 2025-01-14 10:42:32 +01:00
commit 205f9c678e
4 changed files with 72 additions and 2 deletions

View File

@ -242,9 +242,9 @@ databaseChangeLog:
- include:
file: db/changelog/tenant/149-remove-based-on-dict-annotation-id-columns.yaml
- include:
file: db/changelog/tenant/150-add-indexes-across-tables-for-performance.yaml
file: db/changelog/tenant/149-add-indexes-across-tables-for-performance.yaml
- include:
file: db/changelog/tenant/151-add-component-mapping-indexes.yaml
file: db/changelog/tenant/150-add-component-mapping-indexes.yaml
- include:
file: db/changelog/tenant/152-add-ai-fields-to-entity.yaml
- include:
@ -257,3 +257,5 @@ databaseChangeLog:
file: db/changelog/tenant/157-add-included-to-csv-export-field.yaml
- include:
file: db/changelog/tenant/158-add-app-version-history-table-and-layout-parser-version-field-to-file.yaml
- include:
file: db/changelog/tenant/159-cleanup-truncated-indices.yaml

View File

@ -0,0 +1,68 @@
databaseChangeLog:
- changeSet:
id: drop_truncated_idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_time
author: maverick
preConditions:
- onFail: MARK_RAN
- indexExists:
indexName: idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_
tableName: dossier
changes:
- dropIndex:
indexName: idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_
tableName: dossier
- changeSet:
id: create_idx_dossiertemplid_softdeltime_harddeltime_archivtime
author: maverick
preConditions:
- onFail: MARK_RAN
- not:
indexExists:
indexName: idx_dossiertemplid_softdeltime_harddeltime_archivtime
tableName: dossier
changes:
- createIndex:
tableName: dossier
indexName: idx_dossiertemplid_softdeltime_harddeltime_archivtime
columns:
- column:
name: dossier_template_id
- column:
name: soft_deleted_time
- column:
name: hard_deleted_time
- column:
name: archived_time
- changeSet:
id: drop_truncated_idx_notification_preference_user_id_in_app_notifications_enabled
author: maverick
preConditions:
- onFail: MARK_RAN
- indexExists:
indexName: idx_notification_preference_user_id_in_app_notifications_enable
tableName: notification_preference
changes:
- dropIndex:
indexName: idx_notification_preference_user_id_in_app_notifications_enable
tableName: notification_preference
- changeSet:
id: create_idx_notify_pref_userid_app_notif_enabled
author: maverick
preConditions:
- onFail: MARK_RAN
- not:
indexExists:
indexName: idx_notify_pref_userid_app_notif_enabled
tableName: notification_preference
changes:
- createIndex:
tableName: notification_preference
indexName: idx_notify_pref_userid_app_notif_enabled
columns:
- column:
name: user_id
- column:
name: in_app_notifications_enabled