liquibase-changeLog.yml 5.03 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';