databaseChangeLog:
  - logicalFilePath: db-changelog-001034-add-cpti-rm-table.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-001034'
      tagDatabase:
        tag: 'pre-001034'
  - changeSet:
      author: appian
      id: '001034.1.0'
      comment: Create control_panel_tier_item_rm table
      changes:
        - createTable:
            tableName: control_panel_tier_item_rm
            columns:
              - column:
                  name: control_panel_tier_item_id
                  type: ${longType}
                  constraints:
                    nullable: false
                    primaryKey: true
              - column:
                  name: rm_entry_id
                  type: ${longType}
                  constraints:
                    nullable: false
                    primaryKey: true
  - changeSet:
      id: '001034.1.1'
      author: appian
      comment: Add FK for control_panel_tier_item_rm.control_panel_tier_item_id to control_panel_tier_item.id
      changes:
        - addForeignKeyConstraint:
            constraintName: cpti_rm_id_fk
            baseTableName: control_panel_tier_item_rm
            baseColumnNames: control_panel_tier_item_id
            referencedTableName: control_panel_tier_item
            referencedColumnNames: id
  - changeSet:
      id: '001034.1.2'
      author: appian
      comment: Add FK for control_panel_tier_item_rm.rm_entry_id to rm_entry.id
      changes:
        - addForeignKeyConstraint:
            constraintName: cpti_rm_entry_id_fk
            baseTableName: control_panel_tier_item_rm
            baseColumnNames: rm_entry_id
            referencedTableName: rm_entry
            referencedColumnNames: id
  - changeSet:
      id: '001034.1.3'
      author: appian
      comment: Add index on control_panel_tier_item_rm.control_panel_tier_item_id
      changes:
        createIndex:
          columns:
            - column:
                name: control_panel_tier_item_id
          indexName: cpti_rm_id_idx
          tableName: control_panel_tier_item_rm
          unique: false
  - changeSet:
      id: '001034.1.4'
      author: appian
      comment: Add index on control_panel_tier_item_rm.rm_entry_id
      changes:
        createIndex:
          columns:
            - column:
                name: rm_entry_id
          indexName: cpti_rm_entry_id_idx
          tableName: control_panel_tier_item_rm
          unique: false
