All Downloads are FREE. Search and download functionalities are using the official Maven repository.

liquibase.harness.change.changelogs.disableTrigger.xml Maven / Gradle / Ivy

There is a newer version: 1.0.10
Show newest version
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog
        xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
        xmlns:pro="http://www.liquibase.org/xml/ns/pro"
        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.8.xsd">
    <changeSet author="as" id="1">
        <createProcedure
                comments="test_function"
                encoding="UTF-8"
                procedureName="test_function">CREATE OR REPLACE FUNCTION test_function()
            RETURNS trigger
            AS $$
            BEGIN
            RAISE NOTICE 'Test trigger function created';
            RETURN NEW;
            END;
            $$
            LANGUAGE plpgsql;
        </createProcedure>
        <rollback>
            <sql>DROP FUNCTION test_function()</sql>
        </rollback>
    </changeSet>
    <changeSet  author="as" id="2">
        <pro:createTrigger disabled="false"
                           encoding="UTF-8"
                           scope="test"
                           tableName="posts"
                           triggerName="test_trigger">CREATE TRIGGER test_trigger
            BEFORE INSERT ON posts
            FOR EACH ROW EXECUTE PROCEDURE test_function();
        </pro:createTrigger>
        <rollback>
            <pro:dropTrigger triggerName="test_trigger"
                             tableName="posts"/>
        </rollback>
    </changeSet>
    <changeSet author="as" id="3">
        <pro:disableTrigger tableName="posts"
                           triggerName="test_trigger"/>
        <rollback/>
    </changeSet>
</databaseChangeLog>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy