forked from telefonicaid/fiware-orion
-
Notifications
You must be signed in to change notification settings - Fork 43
/
Copy pathtimescale-changelog_v2.xml
57 lines (55 loc) · 2.56 KB
/
timescale-changelog_v2.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
<?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"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog
http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.8.xsd">
<changeSet author="[email protected]" id="v2_step_1">
<comment>Change type of dataset id and add constraint.</comment>
<modifyDataType columnName="datasetid"
schemaName="public"
tableName="attributes"
newDataType="varchar"/>
<addNotNullConstraint columnName="datasetid"
schemaName="public"
tableName="attributes"
defaultNullValue="migration-notNull"
columnDataType="varchar"
constraintName="dataset_id_not_null_attr"/>
<rollback>
<dropNotNullConstraint columnDataType="varchar"
columnName="datasetid"
schemaName="public"
tableName="attributes"/>
<modifyDataType columnName="datasetid"
schemaName="public"
tableName="attributes"
newDataType="text"/>
</rollback>
</changeSet>
<changeSet author="[email protected]" id="v2_step_2">
<comment>Add dataset id to combined primary key for the attributes table.</comment>
<dropPrimaryKey constraintName="attributes_pkey"
dropIndex="true"
schemaName="public"
tableName="attributes"/>
<addPrimaryKey
columnNames="instanceid, ts, datasetid"
constraintName="attributes_pkey"
schemaName="public"
tableName="attributes"
validate="true"/>
<rollback>
<dropPrimaryKey constraintName="attributes_pkey"
dropIndex="true"
schemaName="public"
tableName="attributes"/>
<addPrimaryKey
columnNames="instanceid, ts"
constraintName="attributes_pkey"
schemaName="public"
tableName="attributes"
validate="true"/>
</rollback>
</changeSet>
</databaseChangeLog>