liquibase.changelogs.v3_12_1.schema.yml Maven / Gradle / Ivy
databaseChangeLog:
- changeSet:
id: 3.12.1
author: GraviteeSource Team
preConditions:
- onFail: MARK_RAN
- not:
columnExists:
tableName: ${gravitee_prefix}keys
columnName: id
changes:
- addColumn:
tableName: ${gravitee_prefix}keys
columns:
- column:
name: id
type: nvarchar(64)
- sql:
dbms: mariadb, mysql
sql: update `${gravitee_prefix}keys` set `id` = `key`
- sql:
dbms: postgresql
sql: update ${gravitee_prefix}keys set id = key
- sql:
dbms: mssql
sql: update ${gravitee_prefix}keys set id = [key]
- addNotNullConstraint:
tableName: ${gravitee_prefix}keys
columnDataType: nvarchar(64)
columnName: id
- dropPrimaryKey:
constraintName: pk_${gravitee_prefix}keys
tableName: ${gravitee_prefix}keys
- addPrimaryKey:
constraintName: pk_${gravitee_prefix}keys
columnNames: id
tableName: ${gravitee_prefix}keys
- addColumn:
tableName: ${gravitee_prefix}keys
columns:
- column:
name: api
type: nvarchar(64)
- sql:
dbms: mariadb, mysql
sql: update `${gravitee_prefix}keys` set api = ( select s.api from ${gravitee_prefix}subscriptions s where s.id = subscription)
- sql:
dbms: postgresql, mssql
sql: update ${gravitee_prefix}keys set api = ( select s.api from ${gravitee_prefix}subscriptions s where s.id = subscription)
- addNotNullConstraint:
tableName: ${gravitee_prefix}keys
columnDataType: nvarchar(64)
columnName: api
- createIndex:
indexName: idx_${gravitee_prefix}keys_key
columns:
- column:
name: key
type: nvarchar(64)
tableName: ${gravitee_prefix}keys
- createIndex:
indexName: idx_${gravitee_prefix}keys_key_and_api
columns:
- column:
name: api
type: nvarchar(64)
- column:
name: key
type: nvarchar(64)
tableName: ${gravitee_prefix}keys
© 2015 - 2025 Weber Informatics LLC | Privacy Policy