-
Notifications
You must be signed in to change notification settings - Fork 44
/
liquibase.xml
168 lines (154 loc) · 6.99 KB
/
liquibase.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd">
<changeSet author="rkorytkowski" id="openconceptlab-v1-5">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="concept_reference_map" columnNames="uuid"/></not>
</preConditions>
<comment>Add concept_reference_map_uuid index</comment>
<createIndex tableName="concept_reference_map" indexName="concept_reference_map_uuid">
<column name="uuid" />
</createIndex>
</changeSet>
<changeSet author="rkorytkowski" id="openconceptlab-v1-6">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="concept_reference_source" columnNames="name"/></not>
</preConditions>
<comment>Add concept_reference_source_name index</comment>
<createIndex tableName="concept_reference_source" indexName="concept_reference_source_name">
<column name="name" />
</createIndex>
</changeSet>
<changeSet author="rkorytkowski" id="openconceptlab-v1-7">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="concept_map_type" columnNames="name"/></not>
</preConditions>
<comment>Add concept_map_type_name index</comment>
<createIndex tableName="concept_map_type" indexName="concept_map_type_name">
<column name="name" />
</createIndex>
</changeSet>
<changeSet author="rkorytkowski" id="openconceptlab-v1-8">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="concept_reference_term" columnNames="concept_source_id, code"/></not>
</preConditions>
<comment>Add concept_reference_term_code index</comment>
<createIndex tableName="concept_reference_term" indexName="concept_reference_term_code">
<column name="concept_source_id" />
<column name="code" />
</createIndex>
</changeSet>
<changeSet author="rkorytkowski" id="openconceptlab-v1-9">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="concept_name" columnNames="name, locale, voided"/></not>
</preConditions>
<comment>Add concept_name_duplicate index</comment>
<createIndex tableName="concept_name" indexName="concept_name_duplicate">
<column name="name" />
<column name="locale" />
<column name="voided" />
</createIndex>
</changeSet>
<changeSet id="openconceptlab-v1-03.11.2016-16.10" author="adamgrzybkowski">
<preConditions onFail="MARK_RAN">
<tableExists tableName="openconceptlab_item"/>
</preConditions>
<comment>Drop item table</comment>
<dropTable tableName="openconceptlab_item"/>
</changeSet>
<changeSet id="openconceptlab-v1-03.11.2016-16.11" author="adamgrzybkowski">
<preConditions onFail="MARK_RAN">
<tableExists tableName="openconceptlab_update"/>
</preConditions>
<comment>Drop update table</comment>
<dropTable tableName="openconceptlab_update"/>
</changeSet>
<changeSet id="openconceptlab-v1-03.11.2016-16.12" author="adamgrzybkowski">
<preConditions>
<not><tableExists tableName="openconceptlab_import"/></not>
</preConditions>
<comment>Create import table</comment>
<createTable tableName="openconceptlab_import">
<column autoIncrement="true" name="import_id" type="bigint">
<constraints nullable="false" primaryKey="true"/>
</column>
<column name="uuid" type="char(38)"/>
<column name="local_date_started" type="datetime">
<constraints nullable="false"/>
</column>
<column name="local_date_stopped" type="datetime"/>
<column name="ocl_date_started" type="datetime" />
<column name="error_message" type="varchar(1024)" />
</createTable>
</changeSet>
<changeSet author="adamgrzybkowski" id="openconceptlab-v1-03.11.2016-16.13">
<preConditions>
<not><tableExists tableName="openconceptlab_item"/></not>
</preConditions>
<comment>Create openconceptlab_item table</comment>
<createTable tableName="openconceptlab_item">
<column autoIncrement="true" name="item_id" type="bigint">
<constraints nullable="false" primaryKey="true"/>
</column>
<column name="import_id" type="bigint">
<constraints nullable="false"/>
</column>
<column name="type" type="varchar(512)">
<constraints nullable="false"/>
</column>
<column name="uuid" type="char(38)" />
<column name="version_url" type="varchar(1024)" />
<column name="url" type="varchar(1024)" />
<column name="hashed_url" type="binary(16)" />
<column name="state" type="int">
<constraints nullable="false"/>
</column>
<column name="error_message" type="varchar(1024)" />
</createTable>
<addForeignKeyConstraint constraintName="openconceptlab_item_import" baseTableName="openconceptlab_item" baseColumnNames="import_id" referencedTableName="openconceptlab_import" referencedColumnNames="import_id"/>
</changeSet>
<changeSet author="tomaszmarzeion" id="openconceptlab-v1-12">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="openconceptlab_import" columnName="release_version"/>
</not>
</preConditions>
<comment>Create release_version - See OCLM-38 for details</comment>
<addColumn tableName="openconceptlab_import">
<column name="release_version" type="varchar(512)"/>
</addColumn>
</changeSet>
<changeSet author="adamgrzybkowski" id="openconceptlab-v1-04.11.2016-14.27">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="openconceptlab_item" columnName="updated_on"/>
</not>
</preConditions>
<comment>Create openconceptlab_item_update_on</comment>
<addColumn tableName="openconceptlab_item">
<column name="updated_on" type="datetime"/>
</addColumn>
</changeSet>
<changeSet author="lkukielka" id="openconceptlab-v1-08.11.2016">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="openconceptlab_import" columnName="subscription_url"/>
</not>
</preConditions>
<comment>Add subscription_url column- See OCLM-43 for details</comment>
<addColumn tableName="openconceptlab_import">
<column name="subscription_url" type="text"/>
</addColumn>
</changeSet>
<changeSet author="rkorytkowski" id="openconceptlab-v1-14.03.2018">
<preConditions onFail="MARK_RAN">
<not><indexExists tableName="openconceptlab_item" columnNames="hashed_url"/></not>
</preConditions>
<comment>Add openconceptlab_item_url index</comment>
<createIndex tableName="openconceptlab_item" indexName="openconceptlab_item_url">
<column name="hashed_url" />
</createIndex>
</changeSet>
</databaseChangeLog>