aboutsummaryrefslogtreecommitdiff
path: root/schema
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-09-19 22:10:44 +1200
committerGitHub <noreply@github.com>2017-09-19 22:10:44 +1200
commit6a40551d0e1d63fbb68f0401be73a4c64db4ca64 (patch)
tree36e5d835966f0a7d1d5563e24263b87734c86370 /schema
parent561c616418918da4bb1d75c95347e25c23f72f6a (diff)
parent285f6feea43be782edc6233b709d47b146250361 (diff)
downloadtrackermap-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.tar.gz
trackermap-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.tar.bz2
trackermap-server-6a40551d0e1d63fbb68f0401be73a4c64db4ca64.zip
Merge pull request #3534 from Abyss777/extend_notifications
Implement per device Notifications
Diffstat (limited to 'schema')
-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>