aboutsummaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2016-12-14 17:34:34 +0500
committerAbyss777 <abyss@fox5.ru>2016-12-14 18:02:17 +0500
commitfff8f0c792606daff151624479d9ae9dc54187d5 (patch)
tree97e0ab38de08aba1a7b7adf90283df82d850a3ad /schema
parent4557cf912fada1dc249333aa05215b0116b8ebab (diff)
downloadtraccar-server-fff8f0c792606daff151624479d9ae9dc54187d5.tar.gz
traccar-server-fff8f0c792606daff151624479d9ae9dc54187d5.tar.bz2
traccar-server-fff8f0c792606daff151624479d9ae9dc54187d5.zip
Calendars implementation
Diffstat (limited to 'schema')
-rw-r--r--schema/changelog-3.10.xml45
-rw-r--r--schema/changelog-master.xml1
2 files changed, 46 insertions, 0 deletions
diff --git a/schema/changelog-3.10.xml b/schema/changelog-3.10.xml
new file mode 100644
index 000000000..8cd7b3704
--- /dev/null
+++ b/schema/changelog-3.10.xml
@@ -0,0 +1,45 @@
+<?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.10">
+
+ <changeSet author="author" id="changelog-3.10">
+
+ <createTable tableName="calendars">
+ <column name="id" type="INT" autoIncrement="true">
+ <constraints primaryKey="true" />
+ </column>
+ <column name="name" type="VARCHAR(128)">
+ <constraints nullable="false" />
+ </column>
+ <column name="calendardata" type="BLOB">
+ <constraints nullable="false" />
+ </column>
+ <column name="attributes" type="VARCHAR(4000)">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <createTable tableName="user_calendar">
+ <column name="userid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="calendarid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="user_calendar" baseColumnNames="userid" constraintName="fk_user_calendar_userid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="user_calendar" baseColumnNames="calendarid" constraintName="fk_user_calendar_geofenceid" referencedTableName="calendars" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <addColumn tableName="geofences">
+ <column name="calendarid" type="INT" />
+ </addColumn>
+
+ <addForeignKeyConstraint baseColumnNames="calendarid" baseTableName="geofences" constraintName="fk_geofence_calendar_calendarid" onDelete="SET NULL" onUpdate="RESTRICT" referencedColumnNames="id" referencedTableName="calendars"/>
+
+ </changeSet>
+</databaseChangeLog>
diff --git a/schema/changelog-master.xml b/schema/changelog-master.xml
index 448015568..2aed50e72 100644
--- a/schema/changelog-master.xml
+++ b/schema/changelog-master.xml
@@ -11,4 +11,5 @@
<include file="changelog-3.7.xml" relativeToChangelogFile="true" />
<include file="changelog-3.8.xml" relativeToChangelogFile="true" />
<include file="changelog-3.9.xml" relativeToChangelogFile="true" />
+ <include file="changelog-3.10.xml" relativeToChangelogFile="true" />
</databaseChangeLog>