Change: ‘createView’

Create a new database view

Available Attributes

NameDescriptionRequired ForSupportsSince
catalogNameName of the catalogall3.0
replaceIfExistsUse 'create or replace' syntaxsybase, mssql, postgresql, oracle, firebird, sqlite, h2, mysql1.5
schemaNameName of the schemaall
selectQuerySQL for generating the viewallall
viewNameName of the view to createallall
<changeSet author="liquibase-docs" id="createView-example">
    <createView catalogName="cat"
            replaceIfExists="true"
            schemaName="public"
            viewName="v_person">select id, name from person where id > 10</createView>
</changeSet>
changeSet:
  id: createView-example
  author: liquibase-docs
  changes:
  - createView:
      catalogName: cat
      replaceIfExists: true
      schemaName: public
      selectQuery: select id, name from person where id > 10
      viewName: v_person
{
  "changeSet": {
    "id": "createView-example",
    "author": "liquibase-docs",
    "changes": [
      {
        "createView": {
          "catalogName": "cat",
          "replaceIfExists": true,
          "schemaName": "public",
          "selectQuery": "select id, name from person where id > 10",
          "viewName": "v_person"
        }
      }]
    
  }
}

SQL Generated From Above Sample (MySQL)

CREATE OR REPLACE VIEW cat.v_person AS select id,
 name from person where id > 10;

Database Support

DatabaseNotesAuto Rollback
DB2SupportedYes
DerbySupportedYes
FirebirdSupportedYes
H2SupportedYes
HyperSQLSupportedYes
InformixSupportedYes
MySQLSupportedYes
OracleSupportedYes
PostgreSQLSupportedYes
SQL ServerSupportedYes
SQLiteSupportedYes
SybaseSupportedYes
Sybase AnywhereSupportedYes

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