Need Liquibase® support? Liquibase Pro is now available! Try it out free.
2018 XML Announcement

Change: ‘createTrigger’

Creates a stored trigger

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall
dbmsall3.1
disabledall
encodingall
pathFile containing the procedure text. Either this attribute or a nested procedure text is required.all
procedureBodyall
relativeToChangelogFileall
replaceIfExistsall
schemaNameName of the schemaall
scopeall
tableNameName of the tableall
triggerBodyallall
triggerNameName of the trigger to dropallall
<changeSet author="liquibase-docs"
        id="createTrigger-example"
        objectQuotingStrategy="LEGACY">
    <ext:createTrigger catalogName="cat"
            dbms="h2, oracle"
            disabled="true"
            encoding="UTF-8"
            path="com/example/my-logic.sql"
            relativeToChangelogFile="true"
            replaceIfExists="false"
            schemaName="public"
            scope="A String"
            tableName="person"
            triggerName="A String">A String</ext:createTrigger>
</changeSet>
changeSet:
  id: createTrigger-example
  author: liquibase-docs
  objectQuotingStrategy: LEGACY
  changes:
  - createTrigger:
      catalogName: cat
      dbms: h2, oracle
      disabled: true
      encoding: UTF-8
      path: com/example/my-logic.sql
      procedureBody: |-
        CREATE OR REPLACE PROCEDURE testHello
            IS
            BEGIN
              DBMS_OUTPUT.PUT_LINE('Hello From The Database!');
            END;
      relativeToChangelogFile: true
      replaceIfExists: false
      schemaName: public
      scope: A String
      tableName: person
      triggerBody: A String
      triggerName: A String
{
  "changeSet": {
    "id": "createTrigger-example",
    "author": "liquibase-docs",
    "objectQuotingStrategy": "LEGACY",
    "changes": [
      {
        "createTrigger": {
          "catalogName": "cat",
          "dbms": "h2, oracle",
          "disabled": true,
          "encoding": "UTF-8",
          "path": "com/example/my-logic.sql",
          "procedureBody": "CREATE OR REPLACE PROCEDURE testHello\n    IS\n    BEGIN\n      DBMS_OUTPUT.PUT_LINE('Hello From The Database!');\n    END;",
          "relativeToChangelogFile": true,
          "replaceIfExists": false,
          "schemaName": "public",
          "scope": "A String",
          "tableName": "person",
          "triggerBody": "A String",
          "triggerName": "A String"
        }
      }]
    
  }
}

Database Support

DatabaseNotesAuto Rollback
DB2SupportedNo
DerbyNot SupportedNo
FirebirdNot SupportedNo
H2Not SupportedNo
HyperSQLNot SupportedNo
INGRESNot SupportedNo
InformixNot SupportedNo
MariaDBNot SupportedNo
MySQLNot SupportedNo
OracleSupportedNo
PostgreSQLSupportedNo
SQL ServerSupportedNo
SQLiteNot SupportedNo
SybaseNot SupportedNo
Sybase AnywhereNot SupportedNo

Missing, incomplete or wrong information? Please send a pull request