aboutsummaryrefslogtreecommitdiff
path: root/schema/changelog-3.10.xml
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/changelog-3.10.xml
parent4557cf912fada1dc249333aa05215b0116b8ebab (diff)
downloadtrackermap-server-fff8f0c792606daff151624479d9ae9dc54187d5.tar.gz
trackermap-server-fff8f0c792606daff151624479d9ae9dc54187d5.tar.bz2
trackermap-server-fff8f0c792606daff151624479d9ae9dc54187d5.zip
Calendars implementation
Diffstat (limited to 'schema/changelog-3.10.xml')
-rw-r--r--schema/changelog-3.10.xml45
1 files changed, 45 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>