All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liquibase.changelogs.cockpit.schema-tables.yml Maven / Gradle / Ivy

There is a newer version: 4.6.0-alpha.2
Show newest version
databaseChangeLog:
  - changeSet:
      id: cockpit-tables
      author: GraviteeSource Team
      preConditions:
        # As Cockpit feature will be propably back ported on v3.5.x, we assume that if the table 'installations' already exists it means
        # that we come from v3.5.x with Cockpit feature and we don't have to run this script.
        - onFail: MARK_RAN
          not:
            tableExists:
              tableName: installations
      changes:
        - createTable:
            tableName: organization_hrids
            columns:
              - column: { name: organization_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: hrid, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: pos, type: integer, constraints: { nullable: false } }

        - addPrimaryKey:
            constraintName: pk_organization_hrids
            columnNames: organization_id, hrid
            tableName: organization_hrids

        - createTable:
            tableName: environment_hrids
            columns:
              - column: { name: environment_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: hrid, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: pos, type: integer, constraints: { nullable: false } }

        - addPrimaryKey:
            constraintName: pk_environment_hrids
            columnNames: environment_id, hrid
            tableName: environment_hrids

        - createTable:
            tableName: installations
            columns:
              - column: { name: id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: created_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: updated_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: additional_information, type: clob, constraints: { nullable: true } }

        - sql:
            dbms: postgresql
            sql: ALTER TABLE installations ALTER additional_information TYPE JSON USING additional_information::json

        - sql:
            dbms: mysql
            sql: ALTER TABLE installations MODIFY additional_information JSON;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy