aboutsummaryrefslogtreecommitdiff
path: root/database/db.changelog-3.2.xml
blob: 8c7a0cc8ab37c33c8668404de19b43933f5be3bd (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-normalize">

    <preConditions onFail="MARK_RAN">
      <not>
        <columnExists tableName="user" columnName="id"/>
      </not>
    </preConditions>

    <renameTable oldTableName="quotedUser" newTableName="user" />

    <modifySql>
      <replace replace="quotedUser" with="&quot;user&quot;" />
    </modifySql>

  </changeSet>

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

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

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

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

    <modifyDataType tableName="position" columnName="latitude" newDataType="DOUBLE" />
    <modifyDataType tableName="position" columnName="longitude" newDataType="DOUBLE" />
    <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>
    <modifyDataType tableName="server" columnName="latitude" newDataType="DOUBLE" />
    <modifyDataType tableName="server" columnName="longitude" newDataType="DOUBLE" />

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

  </changeSet>
</databaseChangeLog>