databaseChangeLog:
  - logicalFilePath: db-changelog-001036-add-mining-dur-filter-table.yaml
  - changeSet:
      author: appian
      id: tag-pre-001036
      tagDatabase:
        tag: 'pre-001036'
  - changeSet:
      id: '001036.1.0'
      author: appian
      comment: Create mining_dur_filter table
      changes:
        - createTable:
            tableName: mining_dur_filter
            columns:
              - column:
                  name: id
                  type: ${longType}
                  autoIncrement: ${autoIncrement}
                  constraints:
                    nullable: false
                    primaryKey: true
              - column:
                  name: mining_filter_group_id
                  type: ${longType}
                  constraints:
                    nullable: false
              - column:
                  name: filter_value
                  type: ${longType}
                  constraints:
                    nullable: false
              - column:
                  name: filter_type
                  type: ${byteType}
                  constraints:
                    nullable: false
              - column:
                  name: operator
                  type: ${byteType}
                  constraints:
                    nullable: false
              - column:
                  name: unit
                  type: ${byteType}
                  constraints:
                    nullable: false
              - column:
                  name: pre_activity_name
                  type: ${mediumStringType}
                  constraints:
                    nullable: true
              - column:
                  name: succ_activity_name
                  type: ${mediumStringType}
                  constraints:
                    nullable: true
              - column:
                  name: created_ts
                  type: ${longType}
                  constraints:
                    nullable: false
  - changeSet:
      author: appian
      id: '001036.2.0'
      comment: Create sequence for mining_dur_filter
      changes:
        - preConditions:
            onFail: MARK_RAN
            changeLogPropertyDefined:
              property: createSequence
              value: true
        - createSequence:
            sequenceName: mining_dur_filter_sq
  - changeSet:
      author: appian
      id: '001036.3.0'
      comment: Create index for mining_dur_filter.mining_filter_group_id
      changes:
        - createIndex:
            tableName: mining_dur_filter
            columns:
              - column:
                  name: mining_filter_group_id
            indexName: mining_dur_filter_grp_id_idx
  - changeSet:
      author: appian
      id: '001036.4.0'
      comment: Add fk for base table mining_dur_filter
      changes:
        - addForeignKeyConstraint:
            constraintName: mining_dur_filter_fltrgrp_fk
            baseTableName: mining_dur_filter
            baseColumnNames: mining_filter_group_id
            referencedTableName: mining_filter_group
            referencedColumnNames: id
            onDelete: CASCADE
