databaseChangeLog:
  - changeSet:
      id: change-table-name-image-recategorization
      author: kilian
      changes:
        - renameTable:
            oldTableName: manual_image_recategorization
            newTableName: manual_recategorization
  - changeSet:
      id: added-dictionary-changes-to-manual-recategorization
      author: kilian
      changes:
        - addColumn:
            columns:
              - column:
                  name: add_to_dictionary
                  type: BOOLEAN
            tableName: manual_recategorization
        - addColumn:
            columns:
              - column:
                  name: add_to_all_dossiers
                  type: BOOLEAN
            tableName: manual_recategorization
  - changeSet:
      id: added-dictionary-changes-to-manual-recategorization-2
      author: kilian
      changes:
        - createTable:
            columns:
              - column:
                  constraints:
                    nullable: false
                  name: manual_recategorization_entity_annotation_id
                  type: VARCHAR(255)
              - column:
                  constraints:
                    nullable: false
                  name: manual_recategorization_entity_file_id
                  type: VARCHAR(255)
              - column:
                  name: type_ids_of_dictionaries_with_add
                  type: VARCHAR(255)
            tableName: manual_recategorization_type_ids_of_dictionaries_with_add
        - createTable:
            columns:
              - column:
                  constraints:
                    nullable: false
                  name: manual_recategorization_entity_annotation_id
                  type: VARCHAR(255)
              - column:
                  constraints:
                    nullable: false
                  name: manual_recategorization_entity_file_id
                  type: VARCHAR(255)
              - column:
                  name: type_ids_of_dictionaries_with_delete
                  type: VARCHAR(255)
            tableName: manual_recategorization_type_ids_of_dictionaries_with_delete
  - changeSet:
      id: added-dictionary-changes-to-manual-recategorization-3
      author: kilian
      changes:
        - addForeignKeyConstraint:
            baseColumnNames: manual_recategorization_entity_annotation_id, manual_recategorization_entity_file_id
            baseTableName: manual_recategorization_type_ids_of_dictionaries_with_add
            constraintName: fk_manual_recategorization_to_dictionary_add
            deferrable: false
            initiallyDeferred: false
            onDelete: NO ACTION
            onUpdate: NO ACTION
            referencedColumnNames: annotation_id, file_id
            referencedTableName: manual_recategorization
            validate: true
        - addForeignKeyConstraint:
            baseColumnNames: manual_recategorization_entity_annotation_id, manual_recategorization_entity_file_id
            baseTableName: manual_recategorization_type_ids_of_dictionaries_with_delete
            constraintName: fk_manual_recategorization_to_dictionary_delete
            deferrable: false
            initiallyDeferred: false
            onDelete: NO ACTION
            onUpdate: NO ACTION
            referencedColumnNames: annotation_id, file_id
            referencedTableName: manual_recategorization
            validate: true