databaseChangeLog:
  - logicalFilePath: db-changelog-000380-edit-piee-settings-table.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-000380'
      tagDatabase:
        tag: 'pre-000380'
  - changeSet:
      author: appian
      id: '000380.1.0'
      comment: Update client_secret data type
      modifyDataType:
        tableName: piee_settings
        columnName: client_secret
        newDataType: ${mediumStringType}
  - changeSet:
      author: appian
      id: '000380.1.1'
      comment: Make client_secret non nullable
      dbms: mariadb,mysql
      # Because of http://liquibase.jira.com/browse/CORE-670, on MySQL only, modifying the column
      # type removes the NOT NULL constraint so we have to add it back.
      changes:
        - addNotNullConstraint:
            tableName: piee_settings
            columnName: client_secret
            columnDataType: ${mediumStringType}
  # Because no Appian site should have data in piee_settings, there is no need to address
  # the possibility of existing rows with null friendly values
  - changeSet:
      author: appian
      id: '000380.1.2'
      comment: Make friendly_name non nullable
      changes:
        - addNotNullConstraint:
            tableName: piee_settings
            columnName: friendly_name
            columnDataType: ${shortStringType}
  - changeSet:
      author: appian
      id: '000380.1.3'
      comment: Make friendly_name unique
      changes:
        - addUniqueConstraint:
            columnNames: friendly_name
            tableName: piee_settings
