liquibase-changeLog.yml 13 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
453
454
455

- changeSet:
    id:                  1506155384557-5
    author:              mobreza (generated)
    changes:
    - addAutoIncrement:
      tableName:         repositorygallery
      columnName:        id