aboutsummaryrefslogtreecommitdiff
path: root/database/db.changelog-3.2.xml
blob: a1fc19b063e3b5559c9fb461b3a4882a5bde55c5 (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
58
59
60
61
<?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" columnDataType="FLOAT" />
    <dropDefaultValue tableName="user" columnName="latitude" />
    <modifyDataType tableName="user" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="user" columnName="latitude" columnDataType="DOUBLE" />
    <addDefaultValue tableName="user" columnName="latitude" defaultValueNumeric="0" />
    <dropNotNullConstraint tableName="user" columnName="longitude" columnDataType="FLOAT" />
    <dropDefaultValue tableName="user" columnName="longitude" />
    <modifyDataType tableName="user" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="user" columnName="longitude" columnDataType="DOUBLE" />
    <addDefaultValue tableName="user" columnName="longitude" defaultValueNumeric="0" />

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

    <dropNotNullConstraint tableName="position" columnName="latitude" columnDataType="FLOAT" />
    <modifyDataType tableName="position" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="position" columnName="latitude" columnDataType="DOUBLE" />
    <dropNotNullConstraint tableName="position" columnName="longitude" columnDataType="FLOAT" />
    <modifyDataType tableName="position" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="position" columnName="longitude" columnDataType="DOUBLE" />
    <dropNotNullConstraint tableName="position" columnName="other" columnDataType="VARCHAR(4096)" />
    <renameColumn tableName="position" oldColumnName="other" newColumnName="attributes" columnDataType="VARCHAR(4096)" />
    <addNotNullConstraint tableName="position" columnName="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" columnDataType="FLOAT" />
    <modifyDataType tableName="server" columnName="latitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="server" columnName="latitude" columnDataType="DOUBLE" />
    <addDefaultValue tableName="server" columnName="latitude" defaultValueNumeric="0" />
    <dropNotNullConstraint tableName="server" columnName="longitude" columnDataType="FLOAT" />
    <modifyDataType tableName="server" columnName="longitude" newDataType="DOUBLE" />
    <addNotNullConstraint tableName="server" columnName="longitude" columnDataType="DOUBLE" />
    <addDefaultValue tableName="server" columnName="longitude" defaultValueNumeric="0" />

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

  </changeSet>
</databaseChangeLog>