databaseChangeLog:
  - logicalFilePath: db-changelog-000579-add-scope-id-to-mining-kpi.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-000579'
      tagDatabase:
        tag: 'pre-000579'
  - changeSet:
      author: appian
      id: '000579.1.0'
      comment: Add a mining_scope_id column to the mining_kpi table
      changes:
        - addColumn:
            tableName: mining_kpi
            columns:
              - column:
                  name: mining_scope_id
                  type: ${longType}
                  constraints:
                    nullable: true
  - changeSet:
      author: appian
      id: '000579.2.0'
      comment: Create index for mining_kpi.mining_scope_id
      changes:
        - createIndex:
            indexName: mining_kpi_scope_id_idx
            tableName: mining_kpi
            columns:
              - column:
                  name: mining_scope_id
  - changeSet:
      author: appian
      id: '000579.3.0'
      comment: Add fk for base table mining_kpi
      changes:
        - addForeignKeyConstraint:
            constraintName: mining_kpi_scope_id_fk
            baseTableName: mining_kpi
            baseColumnNames: mining_scope_id
            referencedTableName: mining_scope
            referencedColumnNames: id
