aboutsummaryrefslogtreecommitdiff
path: root/schema/changelog-3.15.xml
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-09-19 10:42:07 +0500
committerAbyss777 <abyss@fox5.ru>2017-09-19 14:46:54 +0500
commit9519b653a8cef055366b0903fdd371c8f86d1206 (patch)
tree330fe6bb9ee1fe45330979f16f16e204e1437447 /schema/changelog-3.15.xml
parentc82fd979ad17ecfb7dd8f3e366c067b66f4cdabc (diff)
downloadtrackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.gz
trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.tar.bz2
trackermap-server-9519b653a8cef055366b0903fdd371c8f86d1206.zip
Implement per device Notifications
Diffstat (limited to 'schema/changelog-3.15.xml')
-rw-r--r--schema/changelog-3.15.xml50
1 files changed, 50 insertions, 0 deletions
diff --git a/schema/changelog-3.15.xml b/schema/changelog-3.15.xml
index f6ed306dc..9756fe696 100644
--- a/schema/changelog-3.15.xml
+++ b/schema/changelog-3.15.xml
@@ -83,5 +83,55 @@
<column name="limitcommands" type="BOOLEAN" defaultValueBoolean="false" />
</addColumn>
+ <addColumn tableName="notifications">
+ <column name="always" type="BOOLEAN" defaultValueBoolean="false" valueBoolean="true">
+ <constraints nullable="false" />
+ </column>
+ </addColumn>
+
+ <createTable tableName="user_notification">
+ <column name="userid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="notificationid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="user_notification" baseColumnNames="userid" constraintName="fk_user_notification_userid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <sql>
+ INSERT INTO user_notification (notificationid, userid) SELECT id AS notificationid, userid FROM notifications;
+ </sql>
+
+ <dropForeignKeyConstraint baseTableName="notifications" constraintName="fk_notifications_userid"/>
+ <dropColumn tableName="notifications" columnName="userid" />
+
+ <addForeignKeyConstraint baseTableName="user_notification" baseColumnNames="notificationid" constraintName="fk_user_notification_notificationid" referencedTableName="notifications" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="group_notification">
+ <column name="groupid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="notificationid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="group_notification" baseColumnNames="groupid" constraintName="fk_group_notification_groupid" referencedTableName="groups" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="group_notification" baseColumnNames="notificationid" constraintName="fk_group_notification_notificationid" referencedTableName="notifications" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <createTable tableName="device_notification">
+ <column name="deviceid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ <column name="notificationid" type="INT">
+ <constraints nullable="false" />
+ </column>
+ </createTable>
+
+ <addForeignKeyConstraint baseTableName="device_notification" baseColumnNames="deviceid" constraintName="fk_device_notification_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
+ <addForeignKeyConstraint baseTableName="device_notification" baseColumnNames="notificationid" constraintName="fk_device_notification_notificationid" referencedTableName="notifications" referencedColumnNames="id" onDelete="CASCADE" />
+
</changeSet>
</databaseChangeLog>