databaseChangeLog:
  - changeSet:
      id: add_component_mapping_version_to_file_entity
      author: kilian
      changes:
        - createTable:
            tableName: file_entity_component_mapping_versions
            columns:
              - column:
                  name: file_entity_id
                  type: VARCHAR(255)
                  constraints:
                    nullable: false
              - column:
                  name: name
                  type: VARCHAR(255)
                  constraints:
                    nullable: false
              - column:
                  name: version
                  type: INT
                  constraints:
                    nullable: false
        - addForeignKeyConstraint:
            baseColumnNames: file_entity_id
            baseTableName: file_entity_component_mapping_versions
            constraintName: fk_component_mapping_version_entity_file
            referencedColumnNames: id
            referencedTableName: file
            onDelete: CASCADE
            onUpdate: CASCADE
