databaseChangeLog: # Application Blocks: upgrade user to BasicUser - changeSet: id: 1495959628118-1 author: matijaobreza (generated) changes: - renameTable: newTableName: userrole oldTableName: user_role - changeSet: id: 1495959628118-3 author: matijaobreza (generated) changes: - renameColumn: columnDataType: varchar(255) newColumnName: fullName oldColumnName: name remarks: Full name of user tableName: user - changeSet: id: 1495959628118-5 author: matijaobreza (generated) changes: - addColumn: tableName: user columns: - column: constraints: nullable: false name: active type: bit - column: name: createdBy type: bigint - column: name: lastModifiedBy type: bigint - column: name: lastModifiedDate type: datetime - column: name: passwordExpires type: datetime - column: name: shortName type: varchar(20) - column: name: version type: integer - changeSet: id: 1495959628118-6 author: mobreza changes: - sql: comment: Migrate user.enabled to user.active = user.enabled; sql: update user set active = enabled; - changeSet: id: 1495959628118-7 author: matijaobreza (generated) changes: - renameColumn: columnDataType: varchar(20) newColumnName: accountType oldColumnName: loginType remarks: Account type tableName: user - sql: comment: loginType#PASSWORD is changed to accountType#LOCAL sql: update user set accountType = 'LOCAL' where accountType = 'PASSWORD'; - changeSet: id: 1495959628118-8 author: mobreza changes: - sql: comment: Assign user.version sql: update user set version = 1 where version is null; - changeSet: id: 1495959628118-9 author: matijaobreza (generated) changes: - addColumn: tableName: user columns: - column: name: createdDate type: datetime - column: name: accountExpires type: datetime - changeSet: id: 1495959628118-10 author: matijaobreza (generated) changes: - addUniqueConstraint: columnNames: shortName constraintName: UC_USERSHORTNAME_COL tableName: user - changeSet: id: 1495959628118-11 author: matijaobreza (generated) changes: - renameColumn: columnDataType: bigint oldColumnName: user_id newColumnName: userId tableName: userrole - renameColumn: columnDataType: varchar(50) oldColumnName: user_role newColumnName: role tableName: userrole # ClassPK - changeSet: id: 1496418311575-1 author: matijaobreza changes: - renameTable: newTableName: classpk oldTableName: classname - changeSet: id: 1496418311575-2 author: matijaobreza (generated) changes: - renameColumn: columnDataType: varchar(250) oldColumnName: className newColumnName: classname tableName: classpk # Country Boundingbox - changeSet: id: 1496779094288-1 author: matijaobreza (generated) changes: - addColumn: tableName: country columns: - column: name: minLongitude type: double - column: name: maxLongitude type: double - column: name: minLatitude type: double - column: name: maxLatitude type: double # System accounts - changeSet: id: 1497558768000-1 author: matijaobreza (generated) changes: - sql: comment: if user#sys==1 convert to accountType#SYSTEM sql: update user set accountType = 'SYSTEM' where sys = 1; - dropColumn: tableName: user columnName: sys rollback: - addColumn: tableName: user columnName: sys type: boolean - sql: comment: accountType#SYSTEM to user#sys==1 sql: update user set sys = 1 where accountType = 'SYSTEM'; - changeSet: id: 1497558768000-2 author: maxymborodenko (generated) changes: - addColumn: tableName: accession columns: - column: name: doi type: varchar(255) rollback: - dropColumn: tableName: accession columnName: doi - changeSet: id: 1497558768000-3 author: maxymborodenko (generated) changes: - addUniqueConstraint: columnNames: doi constraintName: UQ_accession_doi tableName: accession rollback: - dropUniqueConstraint: tableName: accession constraintName: UQ_accession_doi - changeSet: id: 1497558768000-4 author: maxymborodenko (generated) changes: - addColumn: tableName: accessionhistoric columns: - column: name: doi type: varchar(255) - changeSet: id: 1505830865186-1 author: maxymborodenko (generated) changes: - addColumn: tableName: user columns: - column: name: ftpPassword type: varchar(60) # file-repository:0.9-SNAPSHOT - changeSet: id: 1506155384557-1 author: mobreza (generated) changes: - addColumn: columns: - column: constraints: nullable: false name: active type: BIT(1) - column: constraints: nullable: false name: size type: INT(10) - column: name: lastModifiedBy type: BIGINT(19) - column: name: createdBy type: BIGINT(19) tableName: repositorydocument - addNotNullConstraint: columnDataType: varchar(32) columnName: md5Sum tableName: repositorydocument - addNotNullConstraint: columnDataType: varchar(40) columnName: sha1Sum tableName: repositorydocument - addUniqueConstraint: columnNames: path, originalFilename constraintName: UK_iubmgqa5xckodr6fbg6vnne0d tableName: repositorydocument rollback: - dropUniqueConstraint: tableName: repositorydocument constraintName: UK_iubmgqa5xckodr6fbg6vnne0d - dropNotNullConstraint: tableName: repositorydocument columnName: sha1Sum - dropNotNullConstraint: tableName: repositorydocument columnName: md5Sum - dropColumn: tableName: repositorydocument columnName: active - dropColumn: tableName: repositorydocument columnName: size - dropColumn: tableName: repositorydocument columnName: lastModifiedBy - dropColumn: tableName: repositorydocument columnName: createdBy - changeSet: id: 1506155384557-2 author: mobreza (generated) changes: - addColumn: columns: - column: constraints: nullable: false name: active type: BIT(1) - column: constraints: nullable: false name: size type: INT(10) - column: name: lastModifiedBy type: BIGINT(19) - column: name: createdBy type: BIGINT(19) tableName: repositoryfile - addNotNullConstraint: columnDataType: varchar(32) columnName: md5Sum tableName: repositoryfile - addNotNullConstraint: columnDataType: varchar(40) columnName: sha1Sum tableName: repositoryfile - addUniqueConstraint: columnNames: path, originalFilename constraintName: UK_27590ja5w3amn2yj2dryogm6n tableName: repositoryfile rollback: - dropUniqueConstraint: tableName: repositoryfile constraintName: UK_27590ja5w3amn2yj2dryogm6n - dropNotNullConstraint: tableName: repositoryfile columnName: sha1Sum - dropNotNullConstraint: tableName: repositoryfile columnName: md5Sum - dropColumn: tableName: repositoryfile columnName: active - dropColumn: tableName: repositoryfile columnName: size - dropColumn: tableName: repositoryfile columnName: lastModifiedBy - dropColumn: tableName: repositoryfile columnName: createdBy - changeSet: id: 1506155384557-3 author: mobreza (generated) changes: - addColumn: columns: - column: constraints: nullable: false name: active type: BIT(1) - column: name: createdDate type: DATETIME(19) - column: name: createdBy type: BIGINT(19) - column: name: lastModifiedDate type: DATETIME(19) - column: name: lastModifiedBy type: BIGINT(19) tableName: repositorygallery rollback: - dropColumn: tableName: repositorygallery columnName: active - dropColumn: tableName: repositorygallery columnName: createdDate - dropColumn: tableName: repositorygallery columnName: createdBy - dropColumn: tableName: repositorygallery columnName: lastModifiedDate - dropColumn: tableName: repositorygallery columnName: lastModifiedBy - changeSet: id: 1506155384557-4 author: mobreza (generated) changes: - addColumn: columns: - column: constraints: nullable: false name: active type: BIT(1) - column: constraints: nullable: false name: size type: INT(10) - column: name: lastModifiedBy type: BIGINT(19) - column: name: createdBy type: BIGINT(19) tableName: repositoryimage - addNotNullConstraint: columnDataType: varchar(32) columnName: md5Sum tableName: repositoryimage - addNotNullConstraint: columnDataType: varchar(40) columnName: sha1Sum tableName: repositoryimage - addUniqueConstraint: columnNames: path, originalFilename constraintName: UK_88rxxsqrm09geyh5go9ert6qe tableName: repositoryimage rollback: - dropUniqueConstraint: tableName: repositoryimage constraintName: UK_88rxxsqrm09geyh5go9ert6qe - dropNotNullConstraint: tableName: repositoryimage columnName: sha1Sum - dropNotNullConstraint: tableName: repositoryimage columnName: md5Sum - dropColumn: tableName: repositoryimage columnName: active - dropColumn: tableName: repositoryimage columnName: size - dropColumn: tableName: repositoryimage columnName: lastModifiedBy - dropColumn: tableName: repositoryimage columnName: createdBy - changeSet: id: 1506155384557-5 author: mobreza (generated) changes: - dropForeignKeyConstraint: baseTableName: repositorygalleryimage constraintName: FK_rl4ttk3kctjy2nedwwlh8os3p - addAutoIncrement: tableName: repositorygallery columnName: id columnDataType: BIGINT(20) - addForeignKeyConstraint: constraintName: FK_rl4ttk3kctjy2nedwwlh8os3p baseTableName: repositorygalleryimage baseColumnNames: galleryId referencedTableName: repositorygallery referencedColumnNames: id # OAuth from app-blocks-1.3-SNAPSHOT - changeSet: id: 1506594404000-2 author: matijaobreza (generated) comment: naming strategy change for oauthclient changes: - renameColumn: columnDataType: int newColumnName: accessTokenValidity oldColumnName: accessTokenValiditySeconds tableName: oauthclient - renameColumn: columnDataType: int newColumnName: refreshTokenValidity oldColumnName: refreshTokenValiditySeconds tableName: oauthclient - renameColumn: columnDataType: varchar(200) newColumnName: redirect oldColumnName: redirectUris tableName: oauthclient - renameColumn: columnDataType: varchar(200) newColumnName: resource oldColumnName: resourceIds tableName: oauthclient - renameColumn: columnDataType: varchar(200) newColumnName: scope oldColumnName: scope tableName: oauthclient - addColumn: tableName: oauthclient columns: - column: name: grants type: varchar(200) - column: name: autoApprove type: bit constraints: nullable: false - column: name: autoApproveScope type: varchar(200) - dropColumn: tableName: oauthclient columnName: additional_information - changeSet: id: application-blocks-security-1506594404000-2 author: matijaobreza comment: Create 'oauthclientrole' changes: - createTable: tableName: oauthclientrole remarks: OAuth Client role list columns: - column: name: clientId type: bigint constraints: nullable: false - column: name: oauthclientrole type: varchar(200) constraints: nullable: false - addForeignKeyConstraint: constraintName: FK_m2da63y1tfs7mmuv9rht8udt7 baseTableName: oauthclientrole baseColumnNames: clientId referencedTableName: oauthclient referencedColumnNames: id onDelete: CASCADE onUpdate: CASCADE - changeSet: id: 1507131481000-6 author: mobreza changes: - dropColumn: columnName: grants tableName: oauthclient - dropColumn: columnName: authorities tableName: oauthclient - renameColumn: columnDataType: varchar(200) newColumnName: grants oldColumnName: authorizedGrantTypes tableName: oauthclient - sql: comment: Migrate oauthclient , separator to ; sql: update oauthclient set scope = replace(scope, ',', ';'), grants = replace(grants, ',', ';'), redirect = replace(redirect, ',', ';'); - sql: comment: Create oauthclientrole entries sql: insert into oauthclientrole select id, 'USER' from oauthclient; - changeSet: id: 1507131481000-7 author: mobreza changes: - sql: comment: Create oauthclientrole entries sql: update oauthclientrole set oauthclientrole='CLIENT' where oauthclientrole='USER'; - changeSet: id: 1506605582245-23 author: auto-generated changes: - dropTable: cascadeConstraints: true tableName: oauthaccesstoken - createTable: columns: - column: constraints: nullable: false name: tokenId type: VARCHAR(100) - column: name: authentication type: LONGBLOB - column: name: authenticationId type: VARCHAR(100) - column: name: clientId type: VARCHAR(100) - column: name: refreshToken type: VARCHAR(100) - column: name: token type: LONGBLOB - column: name: username type: VARCHAR(100) tableName: oauthaccesstoken - addPrimaryKey: columnNames: tokenId constraintName: PRIMARY tableName: oauthaccesstoken - addUniqueConstraint: columnNames: authenticationId constraintName: UK_mk5dwyhm8t56m9ood899ec3hx tableName: oauthaccesstoken - changeSet: id: 1506605582245-26 author: auto-generated changes: - dropTable: cascadeConstraints: true tableName: oauthrefreshtoken - createTable: columns: - column: constraints: nullable: false name: tokenId type: VARCHAR(100) - column: name: authentication type: LONGBLOB - column: name: token type: LONGBLOB tableName: oauthrefreshtoken - addPrimaryKey: columnNames: tokenId constraintName: PRIMARY tableName: oauthrefreshtoken - changeSet: id: application-blocks-security-1507137884-1 author: matijaobreza comment: Add refreshToken#clientId changes: - addColumn: tableName: oauthrefreshtoken columns: - column: name: clientId type: varchar(100) constraints: nullable: false - changeSet: id: application-blocks-security-1507137884-2 author: matijaobreza 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: 1506155384557-6 author: a.lugovskiy (generated) changes: - addColumn: tableName: article columns: - column: name: template type: boolean defaultValue: false - changeSet: id: 1508141056000-1 author: mobreza comment: mysql doesn't really like the float type changes: - renameColumn: columnDataType: double newColumnName: seqNo oldColumnName: seqNo tableName: accession - renameColumn: columnDataType: double newColumnName: seqNo oldColumnName: seqNo tableName: accessionhistoric - changeSet: id: 1508141056000-2 author: mobreza comment: AccessionData extends VersionedModel (adds active) changes: - addColumn: tableName: accession columns: - column: constraints: nullable: false defaultValue: true name: active type: BIT(1) - addColumn: tableName: accessionhistoric columns: - column: constraints: nullable: false defaultValue: true name: active type: BIT(1) - changeSet: id: 1508309640296-1 author: mobreza comment: Add auditlog table changes: - createTable: columns: - column: autoIncrement: true constraints: primaryKey: true name: id type: BIGINT - column: constraints: nullable: false name: action type: VARCHAR(10) - column: name: createdBy type: BIGINT - column: name: entityId type: BIGINT - column: constraints: nullable: false name: logdate type: datetime(6) - column: name: newState type: LONGTEXT - column: name: previousState type: LONGTEXT - column: constraints: nullable: false name: prop type: VARCHAR(50) - column: constraints: nullable: false name: classPk type: BIGINT - column: name: entityClassPk type: BIGINT tableName: auditlog - createIndex: columns: - column: name: classPk indexName: FK_ebwh7n4mlnm1e8ty78h6n279x tableName: auditlog - createIndex: columns: - column: name: entityClassPk indexName: FK_p30btngbfm13fwebfkmklu4wn tableName: auditlog - createIndex: columns: - column: name: entityId - column: name: classPk - column: name: prop indexName: UK_4jxfygboql2y3pd68nmudrgw tableName: auditlog - addForeignKeyConstraint: baseColumnNames: classPk baseTableName: auditlog constraintName: FK_ebwh7n4mlnm1e8ty78h6n279x deferrable: false initiallyDeferred: false onDelete: NO ACTION onUpdate: NO ACTION referencedColumnNames: id referencedTableName: classpk - addForeignKeyConstraint: baseColumnNames: entityClassPk baseTableName: auditlog constraintName: FK_p30btngbfm13fwebfkmklu4wn deferrable: false initiallyDeferred: false onDelete: NO ACTION onUpdate: NO ACTION referencedColumnNames: id referencedTableName: classpk