aboutsummaryrefslogtreecommitdiff
path: root/schema/changelog-3.10.xml
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-16 00:28:26 +1300
committerGitHub <noreply@github.com>2016-12-16 00:28:26 +1300
commit835853422ce9f1c1fde15a6464c6f0f7eda4fed7 (patch)
tree049fa09050caec98242a0f642d478a533cee5898 /schema/changelog-3.10.xml
parentf76c78a68f249ddb45a2bbae11dd95dd6db743b6 (diff)
parentef9148eea8dd404aba5707898f244a4b7bc26feb (diff)
downloadtrackermap-server-835853422ce9f1c1fde15a6464c6f0f7eda4fed7.tar.gz
trackermap-server-835853422ce9f1c1fde15a6464c6f0f7eda4fed7.tar.bz2
trackermap-server-835853422ce9f1c1fde15a6464c6f0f7eda4fed7.zip
Merge pull request #2686 from Abyss777/calendars
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>