aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-29 22:47:24 +1200
committerGitHub <noreply@github.com>2017-05-29 22:47:24 +1200
commit83b441c2723c3a0cd3e16d1df898f0e45fbed549 (patch)
tree2541f884958a39bbe594f41caf7c9af8a894fe2e
parent12655eb631003dee98b5392686400ea871d9d2ed (diff)
parente99f0118fea6b4d4e87ae1c67115caddccc48813 (diff)
downloadtrackermap-server-83b441c2723c3a0cd3e16d1df898f0e45fbed549.tar.gz
trackermap-server-83b441c2723c3a0cd3e16d1df898f0e45fbed549.tar.bz2
trackermap-server-83b441c2723c3a0cd3e16d1df898f0e45fbed549.zip
Merge pull request #3199 from Abyss777/foreign_key_names
Organize foreign key names
-rw-r--r--schema/changelog-3.12.xml29
1 files changed, 29 insertions, 0 deletions
diff --git a/schema/changelog-3.12.xml b/schema/changelog-3.12.xml
index 137273b49..850287606 100644
--- a/schema/changelog-3.12.xml
+++ b/schema/changelog-3.12.xml
@@ -77,6 +77,35 @@
<addForeignKeyConstraint baseTableName="device_attribute" baseColumnNames="deviceid" constraintName="fk_device_attribute_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
<addForeignKeyConstraint baseTableName="device_attribute" baseColumnNames="attributeid" constraintName="fk_device_attribute_attributeid" referencedTableName="attributes" referencedColumnNames="id" onDelete="CASCADE" />
+ <dropForeignKeyConstraint baseTableName="positions" constraintName="fk_position_deviceid" />
+ <addForeignKeyConstraint baseTableName="positions" baseColumnNames="deviceid" constraintName="fk_positions_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <dropForeignKeyConstraint baseTableName="events" constraintName="fk_event_deviceid" />
+ <addForeignKeyConstraint baseTableName="events" baseColumnNames="deviceid" constraintName="fk_events_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <dropForeignKeyConstraint baseTableName="device_geofence" constraintName="fk_user_device_geofence_deviceid" />
+ <addForeignKeyConstraint baseTableName="device_geofence" baseColumnNames="deviceid" constraintName="fk_device_geofence_deviceid" referencedTableName="devices" referencedColumnNames="id" onDelete="CASCADE" />
+ <dropForeignKeyConstraint baseTableName="device_geofence" constraintName="fk_user_device_geofence_geofenceid" />
+ <addForeignKeyConstraint baseTableName="device_geofence" baseColumnNames="geofenceid" constraintName="fk_device_geofence_geofenceid" referencedTableName="geofences" referencedColumnNames="id" onDelete="CASCADE" />
+
+ <dropForeignKeyConstraint baseTableName="devices" constraintName="fk_device_group_groupid" />
+ <addForeignKeyConstraint baseTableName="devices" baseColumnNames="groupid" constraintName="fk_devices_groupid" onDelete="SET NULL" onUpdate="RESTRICT" referencedColumnNames="id" referencedTableName="groups" />
+
+ <dropForeignKeyConstraint baseTableName="user_calendar" constraintName="fk_user_calendar_geofenceid" />
+ <addForeignKeyConstraint baseTableName="user_calendar" baseColumnNames="calendarid" constraintName="fk_user_calendar_calendarid" referencedTableName="calendars" referencedColumnNames="id" onDelete="CASCADE" />
+
+ </changeSet>
+
+ <changeSet author="author" id="changelog-3.12-notmssql">
+
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <dbms type="mssql" />
+ </not>
+ </preConditions>
+ <dropForeignKeyConstraint baseTableName="groups" constraintName="fk_group_group_groupid" />
+ <addForeignKeyConstraint baseTableName="groups" baseColumnNames="groupid" constraintName="fk_groups_groupid" onDelete="SET NULL" onUpdate="RESTRICT" referencedColumnNames="id" referencedTableName="groups" />
+
</changeSet>
</databaseChangeLog>