aboutsummaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
Diffstat (limited to 'schema')
-rw-r--r--schema/changelog-3.17.xml85
-rw-r--r--schema/changelog-3.3.xml4
-rw-r--r--schema/changelog-3.8.xml6
-rw-r--r--schema/changelog-4.0.xml56
-rw-r--r--schema/changelog-master.xml2
5 files changed, 145 insertions, 8 deletions
diff --git a/schema/changelog-3.17.xml b/schema/changelog-3.17.xml
new file mode 100644
index 000000000..09d07fcf1
--- /dev/null
+++ b/schema/changelog-3.17.xml
@@ -0,0 +1,85 @@
+<?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-3.17">
+
+ <changeSet author="author" id="changelog-3.3-admin">
+
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <columnExists tableName="users" columnName="administrator" />
+ </not>
+ </preConditions>
+
+ <renameColumn tableName="users" columnDataType="BOOLEAN" oldColumnName="admin" newColumnName="administrator" />
+
+ </changeSet>
+
+ <changeSet author="author" id="changelog-3.17">
+
+ <addColumn tableName="events">
+ <column name="maintenanceid" type="INT" />
+ </addColumn>
+
+ <createTable tableName="maintenances">
+ <column name="id" type="INT" autoIncrement="true">
+ <constraints primaryKey="true" />
+ </column>
+ <column name="name" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ <column name="type" type="VARCHAR(128)">
+ <constraints nullable="false" />
+ </column>
+ <column name="start" type="DOUBLE" defaultValueNumeric="0">
+ <constraints nullable="false" />
+ </column>
+ <column name="period" type="DOUBLE" defaultValueNumeric="0">
+ <constraints nullable="false" />
+ </column>
+ <column name="attributes" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <createTable tableName="user_maintenance">
+ <column name="userid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="maintenanceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="user_maintenance" baseColumnNames="userid" constraintName="fk_user_maintenance_userid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="user_maintenance" baseColumnNames="maintenanceid" constraintName="fk_user_maintenance_maintenanceid" referencedTableName="maintenances" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="group_maintenance">
+ <column name="groupid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="maintenanceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="group_maintenance" baseColumnNames="groupid" constraintName="fk_group_maintenance_groupid" referencedTableName="groups" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="group_maintenance" baseColumnNames="maintenanceid" constraintName="fk_group_maintenance_maintenanceid" referencedTableName="maintenances" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="device_maintenance">
+ <column name="deviceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="maintenanceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="device_maintenance" baseColumnNames="deviceid" constraintName="fk_device_maintenance_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="device_maintenance" baseColumnNames="maintenanceid" constraintName="fk_device_maintenance_maintenanceid" referencedTableName="maintenances" referencedColumnNames="id" onDelete="CASCADE" />
+
+ </changeSet>
+</databaseChangeLog>
diff --git a/schema/changelog-3.3.xml b/schema/changelog-3.3.xml
index 6ed8cecaa..e5f29c661 100644
--- a/schema/changelog-3.3.xml
+++ b/schema/changelog-3.3.xml
@@ -33,7 +33,7 @@
<column name="readonly" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false" />
</column>
- <column name="admin" type="BOOLEAN" defaultValueBoolean="false">
+ <column name="administrator" type="BOOLEAN" defaultValueBoolean="false">
<constraints nullable="false" />
</column>
<column name="map" type="VARCHAR(128)" defaultValue="osm">
@@ -181,7 +181,7 @@
<column name="email" value="admin" />
<column name="hashedpassword" value="D33DCA55ABD4CC5BC76F2BC0B4E603FE2C6F61F4C1EF2D47" />
<column name="salt" value="000000000000000000000000000000000000000000000000" />
- <column name="admin" valueBoolean="true" />
+ <column name="administrator" valueBoolean="true" />
</insert>
</changeSet>
diff --git a/schema/changelog-3.8.xml b/schema/changelog-3.8.xml
index 120ddf5cc..c80a8442c 100644
--- a/schema/changelog-3.8.xml
+++ b/schema/changelog-3.8.xml
@@ -121,10 +121,4 @@
</addColumn>
</changeSet>
-
- <changeSet author="author" id="changelog-3.8-dropuniquetoken" failOnError="false">
-
- <dropUniqueConstraint tableName="users" uniqueColumns="token" constraintName="uk_user_token" />
-
- </changeSet>
</databaseChangeLog>
diff --git a/schema/changelog-4.0.xml b/schema/changelog-4.0.xml
new file mode 100644
index 000000000..04e9fe0c4
--- /dev/null
+++ b/schema/changelog-4.0.xml
@@ -0,0 +1,56 @@
+<?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-4.0">
+
+ <changeSet author="author" id="changelog-4.0-renaming">
+
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <tableExists tableName="tc_servers" />
+ </not>
+ </preConditions>
+
+ <renameTable oldTableName="attributes" newTableName="tc_attributes" />
+ <renameTable oldTableName="calendars" newTableName="tc_calendars" />
+ <renameTable oldTableName="commands" newTableName="tc_commands" />
+ <renameTable oldTableName="device_attribute" newTableName="tc_device_attribute" />
+ <renameTable oldTableName="device_command" newTableName="tc_device_command" />
+ <renameTable oldTableName="device_driver" newTableName="tc_device_driver" />
+ <renameTable oldTableName="device_geofence" newTableName="tc_device_geofence" />
+ <renameTable oldTableName="device_maintenance" newTableName="tc_device_maintenance" />
+ <renameTable oldTableName="device_notification" newTableName="tc_device_notification" />
+ <renameTable oldTableName="devices" newTableName="tc_devices" />
+ <renameTable oldTableName="drivers" newTableName="tc_drivers" />
+ <renameTable oldTableName="events" newTableName="tc_events" />
+ <renameTable oldTableName="geofences" newTableName="tc_geofences" />
+ <renameTable oldTableName="group_attribute" newTableName="tc_group_attribute" />
+ <renameTable oldTableName="group_command" newTableName="tc_group_command" />
+ <renameTable oldTableName="group_driver" newTableName="tc_group_driver" />
+ <renameTable oldTableName="group_geofence" newTableName="tc_group_geofence" />
+ <renameTable oldTableName="group_maintenance" newTableName="tc_group_maintenance" />
+ <renameTable oldTableName="group_notification" newTableName="tc_group_notification" />
+ <renameTable oldTableName="groups" newTableName="tc_groups" />
+ <renameTable oldTableName="maintenances" newTableName="tc_maintenances" />
+ <renameTable oldTableName="notifications" newTableName="tc_notifications" />
+ <renameTable oldTableName="positions" newTableName="tc_positions" />
+ <renameTable oldTableName="servers" newTableName="tc_servers" />
+ <renameTable oldTableName="statistics" newTableName="tc_statistics" />
+ <renameTable oldTableName="user_attribute" newTableName="tc_user_attribute" />
+ <renameTable oldTableName="user_calendar" newTableName="tc_user_calendar" />
+ <renameTable oldTableName="user_command" newTableName="tc_user_command" />
+ <renameTable oldTableName="user_device" newTableName="tc_user_device" />
+ <renameTable oldTableName="user_driver" newTableName="tc_user_driver" />
+ <renameTable oldTableName="user_geofence" newTableName="tc_user_geofence" />
+ <renameTable oldTableName="user_group" newTableName="tc_user_group" />
+ <renameTable oldTableName="user_maintenance" newTableName="tc_user_maintenance" />
+ <renameTable oldTableName="user_notification" newTableName="tc_user_notification" />
+ <renameTable oldTableName="user_user" newTableName="tc_user_user" />
+ <renameTable oldTableName="users" newTableName="tc_users" />
+
+ </changeSet>
+
+</databaseChangeLog>
diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml
index 0c6941eed..e8fbc0c4b 100644
--- a/schema/changelog-master.xml
+++ b/schema/changelog-master.xml
@@ -17,4 +17,6 @@
<include file="changelog-3.14.xml" relativeToChangelogFile="true" />
<include file="changelog-3.15.xml" relativeToChangelogFile="true" />
<include file="changelog-3.16.xml" relativeToChangelogFile="true" />
+ <include file="changelog-3.17.xml" relativeToChangelogFile="true" />
+ <include file="changelog-4.0.xml" relativeToChangelogFile="true" />
</databaseChangeLog>