aboutsummaryrefslogtreecommitdiff
path: root/database/db.changelog-3.2.xml
blob: 015c71588288cf5a8147915eaf2a95638d938be3 (plain)
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.4.xsd">

  <changeSet author="author" id="changelog-3.2">

    <preConditions onFail="MARK_RAN">
      <not>
        <columnExists tableName="position" columnName="attributes" />
      </not>
    </preConditions>

    <dropNotNullConstraint tableName="user" columnName="latitude" />
    <dropDefaultValue tableName="user" columnName="latitude" />
    <modifyDataType tableName="user" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="user" columnName="latitude" />
    <addDefaultValue tableName="user" columnName="latitude" defaultValueNumeric="0" />
    <dropNotNullConstraint tableName="user" columnName="longitude" />
    <dropDefaultValue tableName="user" columnName="longitude" />
    <modifyDataType tableName="user" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="user" columnName="longitude" />
    <addDefaultValue tableName="user" columnName="longitude" defaultValueNumeric="0" />

    <dropColumn tableName="device" columnName="dataId" />

    <dropNotNullConstraint tableName="position" columnName="latitude" />
    <modifyDataType tableName="position" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="position" columnName="latitude" />
    <dropNotNullConstraint tableName="position" columnName="longitude" />
    <modifyDataType tableName="position" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="position" columnName="longitude" />
    <renameColumn tableName="position" oldColumnName="other" newColumnName="attributes" columnDataType="VARCHAR(4096)" />

    <dropTable tableName="data" />

    <addColumn tableName="server">
      <column name="bingKey" type="VARCHAR(128)" />
    </addColumn>
    <addColumn tableName="server">
      <column name="mapUrl" type="VARCHAR(128)" />
    </addColumn>
    <dropNotNullConstraint tableName="server" columnName="latitude" />
    <modifyDataType tableName="server" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="server" columnName="latitude" />
    <dropNotNullConstraint tableName="server" columnName="longitude" />
    <modifyDataType tableName="server" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="server" columnName="longitude" />

    <update tableName="traccar">
      <column name="version" valueNumeric="302" />
    </update>

  </changeSet>
</databaseChangeLog>