aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--schema/changelog-3.10.xml28
1 files changed, 27 insertions, 1 deletions
diff --git a/schema/changelog-3.10.xml b/schema/changelog-3.10.xml
index c4d9b7b18..33f02880d 100644
--- a/schema/changelog-3.10.xml
+++ b/schema/changelog-3.10.xml
@@ -62,12 +62,12 @@
</createTable>
<addForeignKeyConstraint baseTableName="user_user" baseColumnNames="userid" constraintName="fk_user_user_userid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
- <addForeignKeyConstraint baseTableName="user_user" baseColumnNames="manageduserid" constraintName="fk_user_user_manageduserid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
<update tableName="users">
<column name="devicelimit" valueNumeric="-1" />
<where>devicelimit = 0</where>
</update>
+ <dropDefaultValue tableName="users" columnName="devicelimit" />
<addDefaultValue tableName="users" columnName="devicelimit" defaultValueNumeric="-1" />
<addColumn tableName="users">
@@ -75,4 +75,30 @@
</addColumn>
</changeSet>
+ <changeSet author="author" id="changelog-3.10-notmssql">
+
+ <preConditions onFail="MARK_RAN">
+ <not>
+ <dbms type="mssql" />
+ </not>
+ </preConditions>
+ <addForeignKeyConstraint baseTableName="user_user" baseColumnNames="manageduserid" constraintName="fk_user_user_manageduserid" referencedTableName="users" referencedColumnNames="id" onDelete="CASCADE" />
+
+ </changeSet>
+
+ <changeSet author="author" id="changelog-3.10-mssql">
+
+ <preConditions onFail="MARK_RAN">
+ <dbms type="mssql" />
+ </preConditions>
+ <sql>
+ CREATE TRIGGER tg_users_delete
+ ON users FOR DELETE
+ AS BEGIN
+ DELETE FROM user_user WHERE managedUserId IN (SELECT deleted.id FROM deleted)
+ END
+ </sql>
+
+ </changeSet>
+
</databaseChangeLog>