Liquibase® version 3.8.2 is now available! Get it for free.
2018 XML Announcement
News 5 Ways to Fix a Bad Database Change in Liquibase
04 Dec 2019

- and/or -

All Previous Posts >>

Change: ‘createSynonym’

Creates a synonym

Available Attributes

NameDescriptionRequired ForSupportsSince
objectCatalogNameall
objectNameallall
objectSchemaNameall
objectTypedb2all
privateall
replaceIfExistsall
synonymCatalogNameall
synonymNameallall
synonymSchemaNameall
<changeSet author="liquibase-docs" id="createSynonym-example">
    <pro:createSynonym objectName="A String"
            objectType="A String"
            private="true"
            replaceIfExists="false"
            synonymName="A String"/>
</changeSet>
changeSet:
  id: createSynonym-example
  author: liquibase-docs
  changes:
  - createSynonym:
      objectName: A String
      objectType: A String
      private: true
      replaceIfExists: false
      synonymName: A String
{
  "changeSet": {
    "id": "createSynonym-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "createSynonym": {
          "objectName": "A String",
          "objectType": "A String",
          "private": true,
          "replaceIfExists": false,
          "synonymName": "A String"
        }
      }]
    
  }
}

SQL Generated From Above Sample (SQL Server)

CREATE SYNONYM [A String] FOR [A String];

Database Support

DatabaseNotesAuto Rollback
DB2SupportedYes
DB2SupportedYes
DerbyNot SupportedYes
FirebirdNot SupportedYes
H2Not SupportedYes
HyperSQLNot SupportedYes
INGRESNot SupportedYes
InformixNot SupportedYes
MariaDBNot SupportedYes
MySQLNot SupportedYes
OracleSupportedYes
PostgreSQLNot SupportedYes
SQL ServerSupportedYes
SQLiteNot SupportedYes
SybaseNot SupportedYes
Sybase AnywhereNot SupportedYes