Move changeset to new changelog

This commit is contained in:
Anton Tananaev 2018-10-22 05:09:55 +04:00
parent e4bbd04c84
commit 3eb9d26150
3 changed files with 49 additions and 41 deletions

View File

@ -646,45 +646,4 @@
</changeSet>
<changeSet author="author" id="changelog-4.0-clean-mssql">
<preConditions onFail="MARK_RAN">
<not>
<changeSetExecuted changeLogFile="changelog-3.3" id="changelog-3.3" author="author" />
</not>
<dbms type="mssql" />
</preConditions>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_groups_delete')
BEGIN
DROP TRIGGER tg_groups_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_groups_delete
ON tc_groups FOR DELETE
AS BEGIN
UPDATE tc_groups SET groupid = NULL WHERE groupid IN (SELECT deleted.id FROM deleted)
END
</sql>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_users_delete')
BEGIN
DROP TRIGGER tg_users_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_users_delete
ON tc_users FOR DELETE
AS BEGIN
DELETE FROM tc_user_user WHERE manageduserid IN (SELECT deleted.id FROM deleted)
END
</sql>
</changeSet>
</databaseChangeLog>

47
schema/changelog-4.1.xml Normal file
View File

@ -0,0 +1,47 @@
<?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-4.1">
<changeSet author="author" id="changelog-4.1-mssql">
<preConditions onFail="MARK_RAN">
<dbms type="mssql" />
</preConditions>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_groups_delete')
BEGIN
DROP TRIGGER tg_groups_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_groups_delete
ON tc_groups FOR DELETE
AS BEGIN
UPDATE tc_groups SET groupid = NULL WHERE groupid IN (SELECT deleted.id FROM deleted)
END
</sql>
<sql>
IF EXISTS (SELECT * FROM sysobjects WHERE type = 'TR' AND name = 'tg_users_delete')
BEGIN
DROP TRIGGER tg_users_delete
END;
</sql>
<sql>
CREATE TRIGGER tg_users_delete
ON tc_users FOR DELETE
AS BEGIN
DELETE FROM tc_user_user WHERE manageduserid IN (SELECT deleted.id FROM deleted)
END
</sql>
</changeSet>
</databaseChangeLog>

View File

@ -22,4 +22,6 @@
<include file="changelog-3.17.xml" relativeToChangelogFile="true" />
<include file="changelog-4.0.xml" relativeToChangelogFile="true" />
<include file="changelog-4.1.xml" relativeToChangelogFile="true" />
</databaseChangeLog>