databaseChangeLog:
  - logicalFilePath: db-changelog-001007-add-pinned-to-mining-scope.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-001007'
      tagDatabase:
        tag: 'pre-001007'

  - changeSet:
      author: appian
      id: '001007.1.0'
      comment: Add new boolean column 'pinned' to mining_scope       
      addColumn:
        tableName: mining_scope
        column:
          name: pinned
          type: ${booleanType}
          defaultValueBoolean: false
          valueBoolean: false
          constraints:
            nullable: false
  - changeSet:
      id: '001007.2.0'
      author: appian
      comment: Update pinned to true for default view for non-postgres DBs
      dbms: '!postgresql'
      sql: UPDATE mining_scope            
        SET pinned = 1
        WHERE id IN (SELECT default_scope_id FROM mining_process_analysis_cfg);
  - changeSet:
      id: '001007.3.0'
      author: appian
      comment: Update pinned to true for default view for postgres
      dbms: postgresql
      sql: UPDATE mining_scope
        SET pinned = true
        WHERE id IN (SELECT default_scope_id FROM mining_process_analysis_cfg);

