liquibase-changeLog.yml 20.8 KB
Newer Older
1 2
databaseChangeLog:

Matija Obreza's avatar
Matija Obreza committed
3
# Application Blocks:    upgrade user to BasicUser
4
- changeSet:
Matija Obreza's avatar
Matija Obreza committed
5 6
    id:                  1495959628118-1
    author:              matijaobreza (generated)
7 8
    changes:
    - renameTable:
Matija Obreza's avatar
Matija Obreza committed
9 10
        newTableName:    userrole
        oldTableName:    user_role
11 12

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
13 14
    id:                  1495959628118-3
    author:              matijaobreza (generated)
15 16
    changes:
    - renameColumn:
Matija Obreza's avatar
Matija Obreza committed
17 18 19 20 21
        columnDataType:  varchar(255)
        newColumnName:   fullName
        oldColumnName:   name
        remarks:         Full name of user
        tableName:       user
22 23

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
24 25
    id:                  1495959628118-5
    author:              matijaobreza (generated)
26 27
    changes:
    - addColumn:
Matija Obreza's avatar
Matija Obreza committed
28
        tableName:       user
29 30 31
        columns:
        - column:
            constraints:
Matija Obreza's avatar
Matija Obreza committed
32 33 34
              nullable:  false
            name:        active
            type:        bit
35
        - column:
Matija Obreza's avatar
Matija Obreza committed
36 37
            name:        createdBy
            type:        bigint
38
        - column:
Matija Obreza's avatar
Matija Obreza committed
39 40
            name:        lastModifiedBy
            type:        bigint
41
        - column:
Matija Obreza's avatar
Matija Obreza committed
42 43
            name:        lastModifiedDate
            type:        datetime
44
        - column:
Matija Obreza's avatar
Matija Obreza committed
45 46
            name:        passwordExpires
            type:        datetime
47
        - column:
Matija Obreza's avatar
Matija Obreza committed
48 49
            name:        shortName
            type:        varchar(20)
50
        - column:
Matija Obreza's avatar
Matija Obreza committed
51 52
            name:        version
            type:        integer
53 54

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
55 56
    id:                  1495959628118-6
    author:              mobreza
57 58
    changes:
    - sql:
Matija Obreza's avatar
Matija Obreza committed
59 60
        comment:         Migrate user.enabled to user.active = user.enabled;
        sql:             update user set active = enabled;
61 62

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
63 64
    id:                  1495959628118-7
    author:              matijaobreza (generated)
65 66
    changes:
    - renameColumn:
Matija Obreza's avatar
Matija Obreza committed
67 68 69 70 71
        columnDataType:  varchar(20)
        newColumnName:   accountType
        oldColumnName:   loginType
        remarks:         Account type
        tableName:       user
72
    - sql:
Matija Obreza's avatar
Matija Obreza committed
73 74
        comment:         loginType#PASSWORD is changed to accountType#LOCAL
        sql:             update user set accountType = 'LOCAL' where accountType = 'PASSWORD';
75 76

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
77 78
    id:                  1495959628118-8
    author:              mobreza
79 80
    changes:
    - sql:
Matija Obreza's avatar
Matija Obreza committed
81 82
        comment:         Assign user.version
        sql:             update user set version = 1 where version is null;
83 84

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
85 86
    id:                  1495959628118-9
    author:              matijaobreza (generated)
87 88
    changes:
    - addColumn:
Matija Obreza's avatar
Matija Obreza committed
89
        tableName:       user
90 91
        columns:
        - column:
Matija Obreza's avatar
Matija Obreza committed
92 93
            name:        createdDate
            type:        datetime
94
        - column:
Matija Obreza's avatar
Matija Obreza committed
95 96
            name:        accountExpires
            type:        datetime
97 98

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
99 100
    id:                  1495959628118-10
    author:              matijaobreza (generated)
101 102
    changes:
    - addUniqueConstraint:
Matija Obreza's avatar
Matija Obreza committed
103 104 105
        columnNames:     shortName
        constraintName:  UC_USERSHORTNAME_COL
        tableName:       user
106 107

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
108 109
    id:                  1495959628118-11
    author:              matijaobreza (generated)
110 111
    changes:
    - renameColumn:
Matija Obreza's avatar
Matija Obreza committed
112 113 114 115
        columnDataType:  bigint
        oldColumnName:   user_id
        newColumnName:   userId
        tableName:       userrole
116
    - renameColumn:
Matija Obreza's avatar
Matija Obreza committed
117 118 119 120
        columnDataType:  varchar(50)
        oldColumnName:   user_role
        newColumnName:   role
        tableName:       userrole
121 122 123

# ClassPK
- changeSet:
Matija Obreza's avatar
Matija Obreza committed
124 125
    id:                  1496418311575-1
    author:              matijaobreza
126 127
    changes:
    - renameTable:
Matija Obreza's avatar
Matija Obreza committed
128 129
        newTableName:    classpk
        oldTableName:    classname
130 131

- changeSet:
Matija Obreza's avatar
Matija Obreza committed
132 133
    id:                  1496418311575-2
    author:              matijaobreza (generated)
134 135
    changes:
    - renameColumn:
Matija Obreza's avatar
Matija Obreza committed
136 137 138 139
        columnDataType:  varchar(250)
        oldColumnName:   className
        newColumnName:   classname
        tableName:       classpk
140 141 142

# Country Boundingbox
- changeSet:
Matija Obreza's avatar
Matija Obreza committed
143 144
    id:                  1496779094288-1
    author:              matijaobreza (generated)
145 146
    changes:
    - addColumn:
Matija Obreza's avatar
Matija Obreza committed
147
        tableName:       country
148 149
        columns:
        - column:
Matija Obreza's avatar
Matija Obreza committed
150 151
            name:        minLongitude
            type:        double
152
        - column:
Matija Obreza's avatar
Matija Obreza committed
153 154
            name:        maxLongitude
            type:        double
155
        - column:
Matija Obreza's avatar
Matija Obreza committed
156 157
            name:        minLatitude
            type:        double
158
        - column:
Matija Obreza's avatar
Matija Obreza committed
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180
            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';
Maxym Borodenko's avatar
Maxym Borodenko committed
181 182 183 184 185 186 187 188 189 190 191

- changeSet:
    id:                  1497558768000-2
    author:              maxymborodenko (generated)
    changes:
    - addColumn:
        tableName:       accession
        columns:
        - column:
            name:        doi
            type:        varchar(255)
192 193 194 195
    rollback:
    - dropColumn:
        tableName:       accession
        columnName:      doi
Maxym Borodenko's avatar
Maxym Borodenko committed
196 197

- changeSet:
198 199
    id:                  1497558768000-3
    author:              maxymborodenko (generated)
Maxym Borodenko's avatar
Maxym Borodenko committed
200 201
    changes:
    - addUniqueConstraint:
202 203 204 205 206 207 208
        columnNames:     doi
        constraintName:  UQ_accession_doi
        tableName:       accession
    rollback:
    - dropUniqueConstraint:
        tableName:       accession
        constraintName:  UQ_accession_doi
Maxym Borodenko's avatar
Maxym Borodenko committed
209 210 211 212 213 214 215 216 217 218

- changeSet:
    id:                  1497558768000-4
    author:              maxymborodenko (generated)
    changes:
    - addColumn:
        tableName:       accessionhistoric
        columns:
        - column:
            name:        doi
219
            type:        varchar(255)
Maxym Borodenko's avatar
Maxym Borodenko committed
220 221 222 223 224 225 226 227 228 229

- changeSet:
    id:                  1505830865186-1
    author:              maxymborodenko (generated)
    changes:
    - addColumn:
        tableName:       user
        columns:
        - column:
            name:        ftpPassword
Matija Obreza's avatar
Matija Obreza committed
230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447
            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
Matija Obreza's avatar
Matija Obreza committed
448 449 450 451 452

- changeSet:
    id:                  1506155384557-5
    author:              mobreza (generated)
    changes:
Matija Obreza's avatar
Matija Obreza committed
453 454 455
    - dropForeignKeyConstraint:
        baseTableName:   repositorygalleryimage
        constraintName:  FK_rl4ttk3kctjy2nedwwlh8os3p
Matija Obreza's avatar
Matija Obreza committed
456
    - addAutoIncrement:
Matija Obreza's avatar
Matija Obreza committed
457 458 459 460 461 462 463 464 465
        tableName:       repositorygallery
        columnName:      id
        columnDataType:  BIGINT(20)
    - addForeignKeyConstraint:
        constraintName:  FK_rl4ttk3kctjy2nedwwlh8os3p
        baseTableName:   repositorygalleryimage
        baseColumnNames: galleryId
        referencedTableName: repositorygallery
        referencedColumnNames: id
Matija Obreza's avatar
Matija Obreza committed
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645


# 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
Matija Obreza's avatar
Matija Obreza committed
646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682


- 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)
683 684 685 686 687 688 689 690 691 692 693 694

- changeSet:
    id:                   1506155384557-6
    author:               a.lugovskiy (generated)
    changes:
    - addColumn:
        tableName:        article
        columns:
        - column:
            name:         template
            type:         boolean
            defaultValue: false