aboutsummaryrefslogtreecommitdiff
path: root/database/db.changelog-3.1.xml
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-18 16:32:46 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-18 16:32:46 +1300
commit5d974ea790397d0646f013e91c8d3b0829ffbd54 (patch)
tree7c4100ddd89d0bf0a4e20b9c165e6e66bed2bc09 /database/db.changelog-3.1.xml
parent2c1aee51f375885b3ee575425814ca8cbe6129ff (diff)
downloadtrackermap-server-5d974ea790397d0646f013e91c8d3b0829ffbd54.tar.gz
trackermap-server-5d974ea790397d0646f013e91c8d3b0829ffbd54.tar.bz2
trackermap-server-5d974ea790397d0646f013e91c8d3b0829ffbd54.zip
Finish Liquibase migration implementation
Diffstat (limited to 'database/db.changelog-3.1.xml')
-rw-r--r--database/db.changelog-3.1.xml102
1 files changed, 91 insertions, 11 deletions
diff --git a/database/db.changelog-3.1.xml b/database/db.changelog-3.1.xml
index b8c706806..589356863 100644
--- a/database/db.changelog-3.1.xml
+++ b/database/db.changelog-3.1.xml
@@ -1,17 +1,97 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<databaseChangeLog
- xmlns="http://www.liquibase.org/xml/ns/dbchangelog/1.9"
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog/1.9
- http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-1.9.xsd">
+<?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.1">
- <createTable tableName="TablesAndTables">
- <column name="COLUMN1" type="TEXT">
- <constraints nullable="true" primaryKey="false" unique="false"/>
- </column>
- </createTable>
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <columnExists tableName="traccar" columnName="version" />
+ </not>
+ </preConditions>
+
+ <modifyDataType tableName="user" columnName="name" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="email" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="hashedPassword" newDataType="VARCHAR(128)" />
+ <dropDefaultValue tableName="user" columnName="salt" />
+ <modifyDataType tableName="user" columnName="salt" newDataType="VARCHAR(128)" />
+ <addDefaultValue tableName="user" columnName="salt" defaultValue="" />
+ <dropDefaultValue tableName="user" columnName="map" />
+ <dropNotNullConstraint tableName="user" columnName="map" columnDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="map" newDataType="VARCHAR(128)" />
+ <dropDefaultValue tableName="user" columnName="language" />
+ <dropNotNullConstraint tableName="user" columnName="language" columnDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="language" newDataType="VARCHAR(128)" />
+ <dropDefaultValue tableName="user" columnName="distanceUnit" />
+ <dropNotNullConstraint tableName="user" columnName="distanceUnit" columnDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="distanceUnit" newDataType="VARCHAR(128)" />
+ <dropDefaultValue tableName="user" columnName="speedUnit" />
+ <dropNotNullConstraint tableName="user" columnName="speedUnit" columnDataType="VARCHAR(128)" />
+ <modifyDataType tableName="user" columnName="speedUnit" newDataType="VARCHAR(128)" />
+ <dropDefaultValue tableName="user" columnName="latitude" />
+ <modifyDataType tableName="user" columnName="latitude" newDataType="FLOAT" />
+ <addDefaultValue tableName="user" columnName="latitude" defaultValueNumeric="0" />
+ <dropDefaultValue tableName="user" columnName="longitude" />
+ <modifyDataType tableName="user" columnName="longitude" newDataType="FLOAT" />
+ <addDefaultValue tableName="user" columnName="longitude" defaultValueNumeric="0" />
+
+ <modifyDataType tableName="device" columnName="name" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="device" columnName="uniqueId" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="device" columnName="status" newDataType="VARCHAR(128)" />
+
+ <dropIndex tableName="user_device" indexName="user_device_user_id" />
+ <createIndex tableName="user_device" indexName="user_device_userId">
+ <column name="userId" />
+ </createIndex>
+
+ <modifyDataType tableName="position" columnName="protocol" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="position" columnName="latitude" newDataType="FLOAT" />
+ <modifyDataType tableName="position" columnName="longitude" newDataType="FLOAT" />
+ <modifyDataType tableName="position" columnName="altitude" newDataType="FLOAT" />
+ <modifyDataType tableName="position" columnName="speed" newDataType="FLOAT" />
+ <modifyDataType tableName="position" columnName="course" newDataType="FLOAT" />
+ <modifyDataType tableName="position" columnName="address" newDataType="VARCHAR(512)" />
+ <modifyDataType tableName="position" columnName="other" newDataType="VARCHAR(4096)" />
+
+ <createIndex tableName="position" indexName="position_deviceId_fixTime">
+ <column name="deviceId" />
+ <column name="fixTime" />
+ </createIndex>
+
+ <modifyDataType tableName="data" columnName="protocol" newDataType="VARCHAR(128)" />
+ <modifyDataType tableName="data" columnName="other" newDataType="VARCHAR(4096)" />
+
+ <addColumn tableName="server">
+ <column name="map" type="VARCHAR(128)" />
+ </addColumn>
+ <addColumn tableName="server">
+ <column name="language" type="VARCHAR(128)" />
+ </addColumn>
+ <addColumn tableName="server">
+ <column name="distanceUnit" type="VARCHAR(128)" />
+ </addColumn>
+ <addColumn tableName="server">
+ <column name="speedUnit" type="VARCHAR(128)" />
+ </addColumn>
+ <modifyDataType tableName="server" columnName="latitude" newDataType="FLOAT" />
+ <addDefaultValue tableName="server" columnName="latitude" defaultValueNumeric="0" />
+ <modifyDataType tableName="server" columnName="longitude" newDataType="FLOAT" />
+ <addDefaultValue tableName="server" columnName="longitude" defaultValueNumeric="0" />
+
+ <dropPrimaryKey tableName="traccar" />
+ <addColumn tableName="traccar">
+ <column name="version" type="INT" defaultValueNumeric="0">
+ <constraints nullable="false" />
+ </column>
+ </addColumn>
+ <dropColumn tableName="traccar" columnName="id" />
+
+ <insert tableName="traccar">
+ <column name="version" valueNumeric="301" />
+ </insert>
</changeSet>
</databaseChangeLog>