Commit fb4fdc52 authored by Andrey Lugovskiy's avatar Andrey Lugovskiy
Browse files

- liquibase

parent d849f33d
......@@ -2692,15 +2692,6 @@ databaseChangeLog:
name: role
type: VARCHAR(255)
tableName: datasetcreator
- changeSet:
id: application-blocks-security-1506594404000-1
author: mobreza
comment: Rename 'clientrole' to 'oauthclientrole'
changes:
- renameTable:
oldTableName: clientrole
newTableName: oauthclientrole
# appblocks-1.3-SNAPSHOT
- changeSet:
......@@ -3055,533 +3046,3 @@ databaseChangeLog:
onUpdate: NO ACTION
referencedColumnNames: id
referencedTableName: acl_sid
## User and OAuthClient extend AclSid
#- changeSet:
# id: 1509390480000-5
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - preConditions:
# - onFail: continue
# - indexExists:
# indexName: UK_9n8jn20f8vcc1jg2i59x6b2ci
# tableName: oauthclient
# - dropIndex:
# tableName: oauthclient
# indexName: UK_9n8jn20f8vcc1jg2i59x6b2ci
#- changeSet:
# id: 1509390480000-6
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - preConditions:
# - onFail: continue
# - foreignKeyConstraintExists:
# foreignKeyName: FK_m2da63y1tfs7mmuv9rht8udt7
# foreignKeyTableName: clientrole
# - dropForeignKeyConstraint:
# baseTableName: clientrole
# constraintName: FK_m2da63y1tfs7mmuv9rht8udt7
#- changeSet:
# id: 1509390480000-20
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - sql:
# comment: Migrate all users with their existing IDs to acl_sid
# sql: >-
# SELECT Count(*)
# INTO @exists;
#
# SET @query = If(@exists>0, 'SELECT \'nothing to rename\' status',
# 'RENAME TABLE acl_entry TO acl_entry_backup');
#
# PREPARE stmt FROM @query;
#
# EXECUTE stmt;
#
#- changeSet:
# id: 1509390480000-21
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - sql:
# comment: Migrate all users with their existing IDs to acl_sid
# sql: >-
# SELECT Count(*) INTO @exists;
#
# SET @query = If(@exists>0, 'SELECT \'nothing to rename\' status',
# 'RENAME TABLE acl_sid TO acl_sid_backup');
#
# PREPARE stmt FROM @query;
#
# EXECUTE stmt;
#
#- changeSet:
# id: 1509390480000-22
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - sql:
# comment: Delete table
# sql: >-
# SET FOREIGN_KEY_CHECKS=0;
# DROP TABLE acl_sid;
# DROP TABLE acl_entry;
# SET FOREIGN_KEY_CHECKS=1;
#
#- changeSet:
# id: 1509390480000-7
# author: matijaobreza
# comment: Migrate ACL to app-blocks-1.3-SNAPSHOT
# changes:
# - createTable:
# columns:
# - column:
# constraints:
# nullable: true
# name: type
# type: INT
# - column:
# autoIncrement: true
# constraints:
# primaryKey: true
# name: id
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: active
# type: BIT(1)
# defaultValue: true
# - column:
# constraints:
# nullable: false
# name: version
# type: INT
# - column:
# name: created_by
# type: BIGINT
# - column:
# name: created_date
# type: datetime(6)
# - column:
# name: last_modified_by
# type: BIGINT
# - column:
# name: last_modified_date
# type: datetime(6)
# - column:
# constraints:
# nullable: false
# name: principal
# type: BIT(1)
# - column:
# constraints:
# nullable: false
# name: sid
# type: VARCHAR(100)
# tableName: acl_sid
# - createTable:
# columns:
# - column:
# autoIncrement: true
# constraints:
# primaryKey: true
# name: id
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: ace_order
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: audit_failure
# type: BIT(1)
# - column:
# constraints:
# nullable: false
# name: audit_success
# type: BIT(1)
# - column:
# constraints:
# nullable: false
# name: granting
# type: BIT(1)
# - column:
# constraints:
# nullable: false
# name: mask
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: acl_object_identity
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: sid
# type: BIGINT
# tableName: acl_entry
# - addUniqueConstraint:
# columnNames: acl_object_identity, ace_order
# constraintName: UK_gh5egfpe4gaqokya6s0567b0l
# tableName: acl_entry
# # Migrate User data to AclSid
# - sql:
# comment: Migrate all users with their existing IDs to acl_sid
# sql: >-
# insert into acl_sid
# (type, id, active, version, created_by, created_date, last_modified_by,
# last_modified_date, principal, sid)
# select
# 1, id, active, version, created_by, created_date, last_modified_by,
# last_modified_date, true, uuid
# from user;
# - addForeignKeyConstraint:
# baseColumnNames: id
# baseTableName: user
# constraintName: FK_8qtpnv06elxuryeuv1ac4ximm
# deferrable: false
# initiallyDeferred: false
# onDelete: NO ACTION
# onUpdate: NO ACTION
# referencedColumnNames: id
# referencedTableName: acl_sid
# - dropColumn:
# tableName: user
# columnName: active
# - dropColumn:
# tableName: user
# columnName: version
# - dropColumn:
# tableName: user
# columnName: created_by
# - dropColumn:
# tableName: user
# columnName: created_date
# - dropColumn:
# tableName: user
# columnName: last_modified_by
# - dropColumn:
# tableName: user
# columnName: last_modified_date
# # Migrate OAuthClient data to AclSid
# - sql:
# comment: Migrate OAuthClient to AclSid, they get new IDs, but we can find them with clientId as acl_sid.sid
# sql: >-
# insert into acl_sid
# (type, active, version, created_by, created_date, last_modified_by,
# last_modified_date, principal, sid)
# select
# 2, active, version, created_by, created_date, last_modified_by,
# last_modified_date, true, client_id
# from oauthclient;
# - sql:
# comment: Update OAuthClient#id values to their new IDs as per acl_sid
# sql: >-
# update oauthclient oa
# join acl_sid sid on sid.sid=oa.client_id
# set oa.id=sid.id
# - addForeignKeyConstraint:
# baseColumnNames: id
# baseTableName: oauthclient
# constraintName: FK_j9t6kj0254t7knyn57orqyaxk
# deferrable: false
# initiallyDeferred: false
# onDelete: NO ACTION
# onUpdate: NO ACTION
# referencedColumnNames: id
# referencedTableName: acl_sid
# - dropColumn:
# tableName: oauthclient
# columnName: active
# - dropColumn:
# tableName: oauthclient
# columnName: version
# - dropColumn:
# tableName: oauthclient
# columnName: created_by
# - dropColumn:
# tableName: oauthclient
# columnName: created_date
# - dropColumn:
# tableName: oauthclient
# columnName: last_modified_by
# - dropColumn:
# tableName: oauthclient
# columnName: last_modified_date
# # Migrate acl_object_identity#owner_sid because these have changed
# - sql:
# comment: Migrate acl_object_identity#owner_sid because these have changed
# sql: >-
# update acl_object_identity oid
# join acl_sid_backup oldsid on oldsid.id=oid.owner_sid
# join acl_sid newsid on newsid.sid=oldsid.sid
# set oid.owner_sid=newsid.id
## - addForeignKeyConstraint:
## baseColumnNames: owner_sid
## baseTableName: acl_object_identity
## constraintName: FK_nxv5we2ion9fwedbkge7syoc3
## deferrable: false
## initiallyDeferred: false
## onDelete: NO ACTION
## onUpdate: NO ACTION
## referencedColumnNames: id
## referencedTableName: acl_sid
# # Migrate acl_sid_backup data for authorities (roles) -- i.e. everything that has not moved
# - sql:
# comment: Delete invalid authority records from acl_sid_backup (users and oauthclients)
# sql: >-
# delete oldsid from acl_sid_backup oldsid
# inner join acl_sid newsid on newsid.sid=oldsid.sid
# where oldsid.principal = 0;
# - sql:
# comment: Generate new acl_sid for ROLE entries (AclSid.type==0)
# sql: >-
# insert into acl_sid
# (type, active, version, created_by, created_date, last_modified_by,
# last_modified_date, principal, sid)
# select
# 0, 1, 0, null, now(), null,
# now(), false, sid
# from acl_sid_backup where principal = 0;
# # Migrate acl_entry data
# - sql:
# comment: Migrate acl_entry_backup data to acl_entry, using new acl_sid#id instead of the old one
# sql: >-
# insert into acl_entry
# (ace_order, audit_failure, audit_success, granting, mask, acl_object_identity, sid)
# select
# e.ace_order, e.audit_failure, e.audit_success, e.granting, e.mask, e.acl_object_identity, newsid.id
# from acl_entry_backup e
# inner join acl_sid_backup oldsid on oldsid.id=e.sid
# inner join acl_sid newsid on newsid.sid=oldsid.sid;
# - dropTable:
# tableName: acl_entry_backup
# # Activate FK constraints
# - addForeignKeyConstraint:
# baseColumnNames: acl_object_identity
# baseTableName: acl_entry
# constraintName: FK_fhuoesmjef3mrv0gpja4shvcr
# deferrable: false
# initiallyDeferred: false
# onDelete: NO ACTION
# onUpdate: NO ACTION
# referencedColumnNames: id
# referencedTableName: acl_object_identity
# - addForeignKeyConstraint:
# baseColumnNames: sid
# baseTableName: acl_entry
# constraintName: FK_i6xyfccd4y3wlwhgwpo4a9rm1
# deferrable: false
# initiallyDeferred: false
# onDelete: NO ACTION
# onUpdate: NO ACTION
# referencedColumnNames: id
# referencedTableName: acl_sid
#- changeSet:
# id: 1504514535226-57
# author: andreylugovskoy (generated)
# changes:
# - addColumn:
# columns:
# - column:
# name: description
# type: clob
# - column:
# constraints:
# nullable: false
# name: title
# type: VARCHAR(200)
# tableName: oauthclient
#- changeSet:
# id: 1504514535226-59
# author: matijaobreza
# comment: Create 'oauthclientrole'
# changes:
# - createTable:
# tableName: oauthclientrole
# remarks: OAuth Client role list
# columns:
# - column:
# name: client_id
# type: bigint
# constraints:
# nullable: false
# - column:
# name: oauthclientrole
# type: varchar(200)
# constraints:
# nullable: false
# - addForeignKeyConstraint:
# constraintName: FK_m2da63y1tfs7mmuv9rht8udt8
# baseTableName: oauthclientrole
# baseColumnNames: client_id
# referencedTableName: oauthclient
# referencedColumnNames: id
# onDelete: CASCADE
# onUpdate: CASCADE
#- changeSet:
# id: 1504514535226-60
# author: andreylugovskoy (generated)
# comment: Extend OAuth Tokens
# changes:
# - addColumn:
# tableName: oauthaccesstoken
# columns:
# - column:
# name: expiration
# type: datetime
# - addColumn:
# tableName: oauthrefreshtoken
# columns:
# - column:
# name: expiration
# type: datetime
# - column:
# name: username
# type: varchar(100)
#
#- changeSet:
# id: 1510582061000-1
# author: mobreza
# changes:
# - addColumn:
# columns:
# - column:
# name: description
# type: LONGTEXT
# tableName: partner
#- changeSet:
# id: 1510582061000-2
# author: alugovskoy
# changes:
# - createTable:
# columns:
# - column:
# autoIncrement: true
# constraints:
# primaryKey: true
# name: id
# type: BIGINT
# - column:
# constraints:
# nullable: false
# name: position
# type: INT
# - column:
# constraints:
# nullable: false
# name: active
# type: BIT(1)
# - column:
# name: version
# type: INT
# - column:
# name: created_by
# type: BIGINT
# - column:
# name: created_date
# type: datetime(6)
# - column:
# name: last_modified_by
# type: BIGINT
# - column:
# name: last_modified_date
# type: datetime(6)
# - column:
# name: acceNumb
# type: varchar(128)
# constraints:
# nullable: false
# - column:
# name: taxGenus
# type: varchar(128)
# constraints:
# nullable: false
# - column:
# name: instCode
# type: varchar(128)
# constraints:
# nullable: false
# - column:
# name: doi
# type: varchar(128)
# tableName: accession
#- changeSet:
# id: 1510582061000-3
# author: alugovskoy
# changes:
# - createIndex:
# columns:
# - column:
# name: doi
# indexName: UQ_accession_doi
# tableName: accession
#- changeSet:
# id: 1510582061000-4
# author: alugovskoy
# changes:
# - createIndex:
# columns:
# - column:
# name: doi
# - column:
# name: taxGenus
# - column:
# name: instCode
# - column:
# name: acceNumb
# indexName: UQ_accession_genus_inst
# tableName: accession
#- changeSet:
# id: 1510582061000-5
# author: alugovskoy
# changes:
# - addColumn:
# columns:
# - column:
# name: accession_id
# type: bigint
# constraints:
# nullable: false
# tableName: datasetaccessions
#- changeSet:
# id: 1510582061000-6
# author: alugovskoy
# changes:
# - dropColumn:
# columns:
# - column:
# name: accession_identifer
# tableName: datasetaccessions
#- changeSet:
# id: 1510582061000-8
# author: alugovskoy
# changes:
# - addForeignKeyConstraint:
# baseColumnNames: accession_id
# baseTableName: datasetaccessions
# constraintName: FK_qydduecfqehd9orguiqldwmxc
# deferrable: false
# initiallyDeferred: false
# onDelete: NO ACTION
# onUpdate: NO ACTION
# referencedColumnNames: id
# referencedTableName: accession
#- changeSet:
# id: 1510582061000-9
# author: alugovskoy
# changes:
# - createIndex:
# columns:
# - column:
# name: accession_id
# indexName: FK_qydduecfqehd9orguiqldwmxc
# tableName: datasetaccessions
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment