aboutsummaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
Diffstat (limited to 'schema')
-rw-r--r--schema/changelog-4.0-clean.xml8
-rw-r--r--schema/changelog-5.0.xml (renamed from schema/changelog-4.16.xml)10
-rw-r--r--schema/changelog-5.1.xml37
-rw-r--r--schema/changelog-5.2.xml21
-rw-r--r--schema/changelog-5.3.xml41
-rw-r--r--schema/changelog-5.4.xml55
-rw-r--r--schema/changelog-5.5.xml15
-rw-r--r--schema/changelog-5.6.xml73
-rw-r--r--schema/changelog-5.7.xml25
-rw-r--r--schema/changelog-5.8.xml18
-rw-r--r--schema/changelog-5.9.xml27
-rw-r--r--schema/changelog-master.xml12
12 files changed, 331 insertions, 11 deletions
diff --git a/schema/changelog-4.0-clean.xml b/schema/changelog-4.0-clean.xml
index f3f814eba..b4d8ac0ba 100644
--- a/schema/changelog-4.0-clean.xml
+++ b/schema/changelog-4.0-clean.xml
@@ -620,14 +620,6 @@
<column name="zoom" valueNumeric="0" />
</insert>
- <insert tableName="tc_users">
- <column name="name" value="admin" />
- <column name="email" value="admin" />
- <column name="hashedpassword" value="D33DCA55ABD4CC5BC76F2BC0B4E603FE2C6F61F4C1EF2D47" />
- <column name="salt" value="000000000000000000000000000000000000000000000000" />
- <column name="administrator" valueBoolean="true" />
- </insert>
-
</changeSet>
<changeSet author="author" id="changelog-4.0-clean-common">
diff --git a/schema/changelog-4.16.xml b/schema/changelog-5.0.xml
index 8bf3a41d5..0e8474eef 100644
--- a/schema/changelog-4.16.xml
+++ b/schema/changelog-5.0.xml
@@ -4,9 +4,15 @@
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"
- logicalFilePath="changelog-4.16">
+ logicalFilePath="changelog-5.0">
- <changeSet author="author" id="changelog-4.16">
+ <changeSet author="author" id="changelog-5.0">
+
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <columnExists tableName="tc_servers" columnName="disablereports" />
+ </not>
+ </preConditions>
<addColumn tableName="tc_servers">
<column name="disablereports" type="BOOLEAN" defaultValueBoolean="false" />
diff --git a/schema/changelog-5.1.xml b/schema/changelog-5.1.xml
new file mode 100644
index 000000000..e972813f6
--- /dev/null
+++ b/schema/changelog-5.1.xml
@@ -0,0 +1,37 @@
+<?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"
+ logicalFilePath="changelog-5.1">
+
+ <changeSet author="author" id="changelog-5.1">
+
+ <createIndex tableName="tc_drivers" indexName="idx_drivers_uniqueid">
+ <column name="uniqueid" />
+ </createIndex>
+
+ <createIndex tableName="tc_devices" indexName="idx_devices_uniqueid">
+ <column name="uniqueid" />
+ </createIndex>
+
+ <createIndex tableName="tc_users" indexName="idx_users_email">
+ <column name="email" />
+ </createIndex>
+
+ <createIndex tableName="tc_users" indexName="idx_users_login">
+ <column name="login" />
+ </createIndex>
+
+ <createIndex tableName="tc_users" indexName="idx_users_token">
+ <column name="token" />
+ </createIndex>
+
+ <addColumn tableName="tc_servers">
+ <column name="overlayurl" type="VARCHAR(512)" />
+ </addColumn>
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.2.xml b/schema/changelog-5.2.xml
new file mode 100644
index 000000000..687024f52
--- /dev/null
+++ b/schema/changelog-5.2.xml
@@ -0,0 +1,21 @@
+<?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"
+ logicalFilePath="changelog-5.2">
+
+ <changeSet author="author" id="changelog-5.2">
+
+ <addColumn tableName="tc_devices">
+ <column name="status" type="CHAR(8)" />
+ </addColumn>
+
+ <addColumn tableName="tc_devices">
+ <column name="geofenceids" type="VARCHAR(128)" />
+ </addColumn>
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.3.xml b/schema/changelog-5.3.xml
new file mode 100644
index 000000000..1e5a6005a
--- /dev/null
+++ b/schema/changelog-5.3.xml
@@ -0,0 +1,41 @@
+<?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"
+ logicalFilePath="changelog-5.3">
+
+ <changeSet author="author" id="changelog-5.3">
+
+ <addColumn tableName="tc_servers">
+ <column name="fixedemail" type="BOOLEAN" defaultValueBoolean="false" />
+ </addColumn>
+
+ <addColumn tableName="tc_users">
+ <column name="fixedemail" type="BOOLEAN" defaultValueBoolean="false" />
+ </addColumn>
+
+ <addColumn tableName="tc_devices">
+ <column name="expirationtime" type="TIMESTAMP" />
+ </addColumn>
+
+ <createTable tableName="tc_keystore">
+ <column autoIncrement="true" name="id" type="INT">
+ <constraints primaryKey="true" />
+ </column>
+ <column name="publickey" type="MEDIUMBLOB">
+ <constraints nullable="false" />
+ </column>
+ <column name="privatekey" type="MEDIUMBLOB">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <dropIndex indexName="idx_users_token" tableName="tc_users" />
+
+ <dropColumn tableName="tc_users" columnName="token" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.4.xml b/schema/changelog-5.4.xml
new file mode 100644
index 000000000..e69bc5fab
--- /dev/null
+++ b/schema/changelog-5.4.xml
@@ -0,0 +1,55 @@
+<?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"
+ logicalFilePath="changelog-5.4">
+
+ <changeSet author="author" id="changelog-5.4">
+
+ <addColumn tableName="tc_devices">
+ <column name="motionstate" type="BOOLEAN" defaultValueBoolean="false" />
+ <column name="motiontime" type="TIMESTAMP" />
+ <column name="motiondistance" type="DOUBLE" defaultValueNumeric="0" />
+ <column name="overspeedstate" type="BOOLEAN" defaultValueBoolean="false" />
+ <column name="overspeedtime" type="TIMESTAMP" />
+ <column name="overspeedgeofenceid" type="INT" defaultValueNumeric="0" />
+ </addColumn>
+
+ <createTable tableName="tc_commands_queue">
+ <column autoIncrement="true" name="id" type="INT">
+ <constraints primaryKey="true" />
+ </column>
+ <column name="deviceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="description" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ <column name="type" type="VARCHAR(128)">
+ <constraints nullable="false" />
+ </column>
+ <column name="textchannel" type="BOOLEAN" defaultValueBoolean="false">
+ <constraints nullable="false" />
+ </column>
+ <column name="attributes" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint
+ baseTableName="tc_commands_queue"
+ baseColumnNames="deviceid"
+ constraintName="fk_commands_queue_deviceid"
+ onDelete="CASCADE"
+ referencedColumnNames="id"
+ referencedTableName="tc_devices" />
+
+ <createIndex tableName="tc_commands_queue" indexName="idx_commands_queue_deviceid">
+ <column name="deviceid" />
+ </createIndex>
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.5.xml b/schema/changelog-5.5.xml
new file mode 100644
index 000000000..4f5b210c5
--- /dev/null
+++ b/schema/changelog-5.5.xml
@@ -0,0 +1,15 @@
+<?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"
+ logicalFilePath="changelog-5.5">
+
+ <changeSet author="author" id="changelog-5.5">
+
+ <dropColumn tableName="tc_commands_queue" columnName="description" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.6.xml b/schema/changelog-5.6.xml
new file mode 100644
index 000000000..dc302c6a4
--- /dev/null
+++ b/schema/changelog-5.6.xml
@@ -0,0 +1,73 @@
+<?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"
+ logicalFilePath="changelog-5.6">
+
+ <changeSet author="author" id="changelog-5.6">
+
+ <addColumn tableName="tc_devices">
+ <column name="motionstreak" type="BOOLEAN" defaultValueBoolean="false" />
+ </addColumn>
+
+ <createTable tableName="tc_reports">
+ <column name="id" type="INT" autoIncrement="true">
+ <constraints primaryKey="true" />
+ </column>
+ <column name="type" type="VARCHAR(32)">
+ <constraints nullable="false" />
+ </column>
+ <column name="description" type="VARCHAR(128)">
+ <constraints nullable="false" />
+ </column>
+ <column name="calendarid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="attributes" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="tc_reports" baseColumnNames="calendarid" constraintName="fk_reports_calendarid" referencedTableName="tc_calendars" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="tc_user_report">
+ <column name="userid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="reportid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="tc_user_report" baseColumnNames="userid" constraintName="fk_user_report_userid" referencedTableName="tc_users" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="tc_user_report" baseColumnNames="reportid" constraintName="fk_user_report_reportid" referencedTableName="tc_reports" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="tc_group_report">
+ <column name="groupid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="reportid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="tc_group_report" baseColumnNames="groupid" constraintName="fk_group_report_groupid" referencedTableName="tc_groups" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="tc_group_report" baseColumnNames="reportid" constraintName="fk_group_report_reportid" referencedTableName="tc_reports" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="tc_device_report">
+ <column name="deviceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="reportid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="tc_device_report" baseColumnNames="deviceid" constraintName="fk_device_report_deviceid" referencedTableName="tc_devices" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="tc_device_report" baseColumnNames="reportid" constraintName="fk_device_report_reportid" referencedTableName="tc_reports" referencedColumnNames="id" onDelete="CASCADE" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.7.xml b/schema/changelog-5.7.xml
new file mode 100644
index 000000000..ad15ac48c
--- /dev/null
+++ b/schema/changelog-5.7.xml
@@ -0,0 +1,25 @@
+<?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"
+ logicalFilePath="changelog-5.7">
+
+ <changeSet author="author" id="changelog-5.7">
+
+ <addColumn tableName="tc_notifications">
+ <column name="commandid" type="INT" />
+ </addColumn>
+
+ <addForeignKeyConstraint
+ baseTableName="tc_notifications"
+ baseColumnNames="commandid"
+ constraintName="fk_notifications_commandid"
+ referencedTableName="tc_commands"
+ referencedColumnNames="id"
+ onDelete="CASCADE" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.8.xml b/schema/changelog-5.8.xml
new file mode 100644
index 000000000..ec54bf17f
--- /dev/null
+++ b/schema/changelog-5.8.xml
@@ -0,0 +1,18 @@
+<?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"
+ logicalFilePath="changelog-5.8">
+
+ <changeSet author="author" id="changelog-5.8">
+
+ <dropColumn tableName="tc_devices" columnName="geofenceids" />
+ <addColumn tableName="tc_positions">
+ <column name="geofenceids" type="VARCHAR(128)" />
+ </addColumn>
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-5.9.xml b/schema/changelog-5.9.xml
new file mode 100644
index 000000000..50a3d3aaa
--- /dev/null
+++ b/schema/changelog-5.9.xml
@@ -0,0 +1,27 @@
+<?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"
+ logicalFilePath="changelog-5.9">
+
+ <changeSet author="author" id="changelog-5.9">
+
+ <addColumn tableName="tc_devices">
+ <column name="calendarid" type="INT" />
+ </addColumn>
+
+ <addForeignKeyConstraint
+ baseTableName="tc_devices"
+ baseColumnNames="calendarid"
+ constraintName="fk_devices_calendarid"
+ referencedTableName="tc_calendars"
+ referencedColumnNames="id"
+ onDelete="SET NULL"
+ onUpdate="RESTRICT"
+ />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml
index d79e084f6..331d5ec78 100644
--- a/schema/changelog-master.xml
+++ b/schema/changelog-master.xml
@@ -29,6 +29,16 @@
<include file="changelog-4.11.xml" relativeToChangelogFile="true" />
<include file="changelog-4.13.xml" relativeToChangelogFile="true" />
<include file="changelog-4.15.xml" relativeToChangelogFile="true" />
- <include file="changelog-4.16.xml" relativeToChangelogFile="true" />
+
+ <include file="changelog-5.0.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.1.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.2.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.3.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.4.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.5.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.6.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.7.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.8.xml" relativeToChangelogFile="true" />
+ <include file="changelog-5.9.xml" relativeToChangelogFile="true" />
</databaseChangeLog>