databaseChangeLog:
  - changeSet:
      id: create_index_if_not_exists_idx_file_last_updated
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_file_last_updated
              tableName: file
      changes:
        - createIndex:
            tableName: file
            indexName: idx_file_last_updated
            columns:
              - column:
                  name: last_updated

  - changeSet:
      id: create_index_if_not_exists_idx_file_deleted_hard_deleted_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_file_deleted_hard_deleted_time
              tableName: file
      changes:
        - createIndex:
            tableName: file
            indexName: idx_file_deleted_hard_deleted_time
            columns:
              - column:
                  name: deleted
              - column:
                  name: hard_deleted_time

  - changeSet:
      id: create_index_if_not_exists_idx_file_dossier_id_deleted_hard_deleted_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_file_dossier_id_deleted_hard_deleted_time
              tableName: file
      changes:
        - createIndex:
            tableName: file
            indexName: idx_file_dossier_id_deleted_hard_deleted_time
            columns:
              - column:
                  name: dossier_id
              - column:
                  name: deleted
              - column:
                  name: hard_deleted_time

  - changeSet:
      id: create_index_if_not_exists_idx_dossier_last_updated
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_dossier_last_updated
              tableName: dossier
      changes:
        - createIndex:
            tableName: dossier
            indexName: idx_dossier_last_updated
            columns:
              - column:
                  name: last_updated

  - changeSet:
      id: create_index_if_not_exists_idx_dossier_soft_deleted_time_hard_deleted_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_dossier_soft_deleted_time_hard_deleted_time
              tableName: dossier
      changes:
        - createIndex:
            tableName: dossier
            indexName: idx_dossier_soft_deleted_time_hard_deleted_time
            columns:
              - column:
                  name: soft_deleted_time
              - column:
                  name: hard_deleted_time

  - changeSet:
      id: create_index_if_not_exists_idx_dossier_id_soft_deleted_time_hard_deleted_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_dossier_id_soft_deleted_time_hard_deleted_time
              tableName: dossier
      changes:
        - createIndex:
            tableName: dossier
            indexName: idx_dossier_id_soft_deleted_time_hard_deleted_time
            columns:
              - column:
                  name: id
              - column:
                  name: soft_deleted_time
              - column:
                  name: hard_deleted_time

  - changeSet:
      id: create_index_if_not_exists_idx_dossier_soft_deleted_time_hard_deleted_time_archived_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_dossier_soft_deleted_time_hard_deleted_time_archived_time
              tableName: dossier
      changes:
        - createIndex:
            tableName: dossier
            indexName: idx_dossier_soft_deleted_time_hard_deleted_time_archived_time
            columns:
              - column:
                  name: soft_deleted_time
              - column:
                  name: hard_deleted_time
              - column:
                  name: archived_time

  - changeSet:
      id: create_index_if_not_exists_idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_time_archived_time
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_time_archived_time
              tableName: dossier
      changes:
        - createIndex:
            tableName: dossier
            indexName: idx_dossier_dossier_template_id_soft_deleted_time_hard_deleted_time_archived_time
            columns:
              - column:
                  name: dossier_template_id
              - column:
                  name: soft_deleted_time
              - column:
                  name: hard_deleted_time
              - column:
                  name: archived_time

  - changeSet:
      id: create_index_if_not_exists_idx_notification_preference_user_id_in_app_notifications_enabled
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_notification_preference_user_id_in_app_notifications_enabled
              tableName: notification_preference
      changes:
        - createIndex:
            tableName: notification_preference
            indexName: idx_notification_preference_user_id_in_app_notifications_enabled
            columns:
              - column:
                  name: user_id
              - column:
                  name: in_app_notifications_enabled

  - changeSet:
      id: create_index_if_not_exists_idx_notification_user_id_creation_date_soft_deleted
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_notification_user_id_creation_date_soft_deleted
              tableName: notification
      changes:
        - createIndex:
            tableName: notification
            indexName: idx_notification_user_id_creation_date_soft_deleted
            columns:
              - column:
                  name: user_id
              - column:
                  name: creation_date
              - column:
                  name: soft_deleted

  - changeSet:
      id: create_index_if_not_exists_idx_entity_dossier_template_id
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_entity_dossier_template_id
              tableName: entity
      changes:
        - createIndex:
            tableName: entity
            indexName: idx_entity_dossier_template_id
            columns:
              - column:
                  name: dossier_template_id

  - changeSet:
      id: create_index_if_not_exists_idx_entity_dossier_id
      author: Timo
      preConditions:
        - not:
            indexExists:
              indexName: idx_entity_dossier_id
              tableName: entity
      changes:
        - createIndex:
            tableName: entity
            indexName: idx_entity_dossier_id
            columns:
              - column:
                  name: dossier_id
