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

liquibase.changelogs.v3_10_0.schema.yml Maven / Gradle / Ivy

There is a newer version: 4.6.0-alpha.2
Show newest version
databaseChangeLog:
  - changeSet:
      id: 3.10.0
      author: GraviteeSource Team
      changes:

        # Flows
        ########################
        - addColumn:
            tableName: flows
            columns:
              - column: { name: flow_order, type: int, constraints: { nullable: true } }

        # Users
        ##############
        - createTable:
            tableName: organization_users
            columns:
              - column: { name: id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: external_id, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: username, type: nvarchar(320), constraints: { nullable: true } }
              - column: { name: password, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: email, type: nvarchar(320), constraints: { nullable: true } }
              - column: { name: display_name, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: nick_name, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: first_name, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: last_name, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: title, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: type, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: preferred_language, type: nvarchar(10), constraints: { nullable: true } }
              - column: { name: account_non_expired, type: boolean, constraints: { nullable: true } }
              - column: { name: account_locked_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: account_locked_until, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: account_non_locked, type: boolean, constraints: { nullable: true } }
              - column: { name: credentials_non_expired, type: boolean, constraints: { nullable: true } }
              - column: { name: enabled, type: boolean, constraints: { nullable: true } }
              - column: { name: internal, type: boolean, constraints: { nullable: true } }
              - column: { name: pre_registration, type: boolean, constraints: { nullable: true } }
              - column: { name: registration_completed, type: boolean, constraints: { nullable: true } }
              - column: { name: newsletter, type: boolean, constraints: { nullable: true } }
              - column: { name: registration_user_uri, type: nvarchar(1024), constraints: { nullable: true } }
              - column: { name: registration_access_token, type: clob, constraints: { nullable: true } }
              - column: { name: reference_type, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: reference_id, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: source, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: client, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: logins_count, type: integer, constraints: { nullable: true } }
              - column: { name: logged_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: created_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: updated_at, type: timestamp(6), constraints: { nullable: true } }
              - column: { name: x509_certificates, type: clob, constraints: { nullable: true } }
              - column: { name: factors, type: clob, constraints: { nullable: true } }
              - column: { name: additional_information, type: clob, constraints: { nullable: true } }

        - sql:
            dbms: postgresql
            sql: ALTER TABLE organization_users ALTER x509_certificates TYPE JSON USING x509_certificates::json

        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users MODIFY x509_certificates JSON;

        - sql:
            dbms: postgresql
            sql: ALTER TABLE organization_users ALTER factors TYPE JSON USING factors::json

        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users MODIFY factors JSON;

        - sql:
            dbms: postgresql
            sql: ALTER TABLE organization_users ALTER additional_information TYPE JSONB USING additional_information::jsonb

        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_email ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'email')))
        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_family_name ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'family_name')))
        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_given_name ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'given_name')))
        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_middle_name ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'middle_name')))
        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_locale ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'locale')))
        - sql:
            dbms: postgresql
            sql: CREATE INDEX idx_ousers_additional_info_zoneinfo ON organization_users USING BTREE (reference_id, reference_type, ((additional_information->>'zoneinfo')))

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

        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_email VARCHAR(320) AS (JSON_UNQUOTE(additional_information->"$.email"));
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_family_name VARCHAR(128) AS (JSON_UNQUOTE(additional_information->"$.family_name"));
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_given_name VARCHAR(128) AS (JSON_UNQUOTE(additional_information->"$.given_name")) ;
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_middle_name VARCHAR(128) AS (JSON_UNQUOTE(additional_information->"$.middle_name"));
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_profile VARCHAR(1024) AS (JSON_UNQUOTE(additional_information->"$.profile"));
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_locale VARCHAR(35) AS (JSON_UNQUOTE(additional_information->"$.locale"));
        - sql:
            dbms: mysql
            sql: ALTER TABLE organization_users ADD additional_information_zoneinfo VARCHAR(256) AS (JSON_UNQUOTE(additional_information->"$.zoneinfo"));

        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_email VARCHAR(320) AS (JSON_VALUE(additional_information, "$.email"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_family_name VARCHAR(128) AS (JSON_VALUE(additional_information, "$.family_name"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_given_name VARCHAR(128) AS (JSON_VALUE(additional_information, "$.given_name"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_middle_name VARCHAR(128) AS (JSON_VALUE(additional_information, "$.middle_name"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_profile VARCHAR(1024) AS (JSON_VALUE(additional_information, "$.profile"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_locale VARCHAR(35) AS (JSON_VALUE(additional_information, "$.locale"));
        - sql:
            dbms: mariadb
            sql: ALTER TABLE organization_users ADD additional_information_zoneinfo VARCHAR(256) AS (JSON_VALUE(additional_information, "$.zoneinfo"));

        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_email ON organization_users(reference_id, reference_type, additional_information_email);
        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_family_name ON organization_users(reference_id, reference_type, additional_information_family_name);
        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_given_name ON organization_users(reference_id, reference_type, additional_information_given_name);
        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_middle_name ON organization_users(reference_id, reference_type, additional_information_middle_name);
        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_locale ON organization_users(reference_id, reference_type, additional_information_locale);
        - sql:
            dbms: mysql, mariadb
            sql: CREATE INDEX idx_ousers_additional_information_zoneinfo ON organization_users(reference_id, reference_type, additional_information_zoneinfo);

        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_email AS JSON_VALUE(additional_information, '$.email');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_family_name AS JSON_VALUE(additional_information, '$.family_name');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_given_name AS JSON_VALUE(additional_information, '$.given_name');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_middle_name AS JSON_VALUE(additional_information, '$.middle_name');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_profile AS JSON_VALUE(additional_information, '$.profile');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_locale AS JSON_VALUE(additional_information, '$.locale');
        - sql:
            dbms: mssql
            sql: ALTER TABLE organization_users ADD additional_information_zoneinfo AS JSON_VALUE(additional_information, '$.zoneinfo');

        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_email ON organization_users(reference_id, reference_type, additional_information_email);
        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_family_name ON organization_users(reference_id, reference_type, additional_information_family_name);
        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_given_name ON organization_users(reference_id, reference_type, additional_information_given_name);
        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_middle_name ON organization_users(reference_id, reference_type, additional_information_middle_name);
        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_locale ON organization_users(reference_id, reference_type, additional_information_locale);
        - sql:
            dbms: mssql
            sql: CREATE INDEX idx_ousers_additional_information_zoneinfo ON organization_users(reference_id, reference_type, additional_information_zoneinfo);

        - addPrimaryKey:
            constraintName: pk_organization_users
            columnNames: id
            tableName: organization_users

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
            indexName: idx_org_users_reference
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: email
            indexName: idx_org_users_reference_email
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: username
            indexName: idx_org_users_reference_username
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: display_name
            indexName: idx_org_users_reference_displayname
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: first_name
            indexName: idx_org_users_reference_firstname
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: last_name
            indexName: idx_org_users_reference_lastname
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: external_id
            indexName: idx_org_users_reference_external
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: username
              - column:
                  name: source
            indexName: idx_org_users_reference_username_source
            tableName: organization_users
            unique: false

        - createIndex:
            columns:
              - column:
                  name: reference_id
              - column:
                  name: reference_type
              - column:
                  name: external_id
              - column:
                  name: source
            indexName: idx_org_users_reference_externalid_source
            tableName: organization_users
            unique: false

        - createTable:
            tableName: organization_user_entitlements
            columns:
              - column: { name: user_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: entitlement, type: nvarchar(64), constraints: { nullable: false } }

        - createIndex:
            columns:
              - column:
                  name: user_id
            indexName: idx_org_user_entitlements_user
            tableName: organization_user_entitlements
            unique: false

        - createTable:
            tableName: organization_user_roles
            columns:
              - column: { name: user_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: role, type: nvarchar(64), constraints: { nullable: false } }

        - createIndex:
            columns:
              - column:
                  name: user_id
            indexName: idx_org_user_roles_user
            tableName: organization_user_roles
            unique: false

        - createTable:
            tableName: organization_user_addresses
            columns:
              - column: { name: user_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: type, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: formatted, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: street_address, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: locality, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: region, type: nvarchar(255), constraints: { nullable: true } }
              - column: { name: postal_code, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: country, type: nvarchar(64), constraints: { nullable: true } }
              - column: { name: primary, type: boolean, constraints: { nullable: true } }

        - createIndex:
            columns:
              - column:
                  name: user_id
            indexName: idx_org_user_addresses_user
            tableName: organization_user_addresses
            unique: false

        - createTable:
            tableName: organization_user_attributes
            columns:
              - column: { name: user_id, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: user_field, type: nvarchar(64), constraints: { nullable: false } }
              - column: { name: value, type: clob, constraints: { nullable: true } }
              - column: { name: type, type: nvarchar(128), constraints: { nullable: true } }
              - column: { name: primary, type: boolean, constraints: { nullable: true } }

        - createIndex:
            columns:
              - column:
                  name: user_id
            indexName: idx_org_user_attributes_user
            tableName: organization_user_attributes
            unique: false




© 2015 - 2024 Weber Informatics LLC | Privacy Policy