databaseChangeLog:
  - logicalFilePath: db-changelog-000568-add-url-stub-column-to-studio-object.yaml
  - changeSet:
      author: appian
      id: 'tag-pre-000568'
      tagDatabase:
        tag: 'pre-000568'

  - changeSet:
      id: '000568.1.0'
      author: appian
      comment: Add url_stub to studio
      addColumn:
        tableName: studio
        column:
          name: url_stub
          type: ${shortStringType}
          constraints:
            nullable: true

  - changeSet:
      id: '000568.1.1'
      author: appian
      comment: Copy the uuid column into url_stub
      sql: UPDATE studio SET url_stub = uuid

  - changeSet:
      id: '000568.1.2'
      author: appian
      comment: Add not null constraint to url_stub column
      changes:
        - addNotNullConstraint:
            tableName: studio
            columnName: url_stub
            columnDataType: ${shortStringType}

  - changeSet:
      id: '000568.1.3'
      author: appian
      comment: Add unique constraint to url_stub column
      changes:
        - addUniqueConstraint:
            tableName: studio
            columnNames: url_stub
            constraintName: studio_url_stub_uc
