Liquibase Enterprise was formerly known as Datical DB.

SQL Server Database Objects and Packaging

Qualifying Object Names

  • Do not qualify objects with the database name. Datical takes care of that.
  • For a Single-Schema project, you do not have to qualify object names with the schema name. If not qualified, Datical uses the default schema for the user (dbo is the default).
  • For a Multi-Schema project, you must qualify object names with the schema name so they get deployed to the correct schema during packaging.
  • For a Multi-Database project,  you must qualify object names with the schema name so they get deployed to the correct schema during packaging. You typically organized folders by database and schema. You may also use only the database folder level. See Multi-database Projects

SQL Server SCM Packaging Patterns

Note that Datical packages non-transient files differently from transient files. Place scripts for Oracle objects in packaging folders as follows. 

  • Non-transient - In-place editing, packaging and no archiving of database changes so they can be managed similar to application code. This applies to the following object types:
    • Procedures (when scripts are placed in the procedure folder)
    • Functions (when scripts are placed in the function folder)
    • Views (when scripts are placed in the view folder)
    • Triggers (when scripts are placed in the trigger folder)
  • Transient - Database changes are archived after packaging (all other folders).

Objects and Packaging Folders

Use the specified folder for listed SQL Server database operations. 

Operation and Object TypePackaging Folders (fixed folders)Package Methods (flexible folders)ArchivedNotes
CREATE/ALTER/DROP DATABASE LINKsql_directdirectYes
CREATE/ALTER/DROP FUNCTIONfunctionstoredlogicNo
CREATE/ALTER/DROP INDEXddl, ddl_direct, sql_directconvert, ddl_direct, directYes
CREATE/ALTER/DROP PROCEDUREprocedurestoredlogicNo
CREATE/ALTER/DROP QUEUEsql_directdirectYes
CREATE/ALTER/DROP SEQUENCEddl, ddl_direct, sql_directconvert, ddl_direct, directYes
CREATE/ALTER/DROP SYNONYMddl, ddl_direct, sql_directconvert, ddl_direct, directYes

For ALTER and CREATE OR REPLACE synonym use ddl_direct or sql_direct/direct. (Do not use ddl/convert with ALTER and CREATE OR REPLACE synonym.)

CREATE/ALTER/DROP TABLE

ddl, ddl_direct, sql_directconvert, ddl_direct, directYes
CREATE/ALTER/DROP TRIGGER

trigger

storedlogicNo
CREATE/ALTER/DROP TYPEsql_directdirectYes
CREATE/ALTER/DROP VIEW

view

storedlogicNo
CREATE/ALTER/DROP VIEW INDEXddl, ddl_direct, sql_directconvert, ddl_direct, directYes
RENAME <DB_OBJECT>sql_directdirectYes
OperationPackaging Folder (fixed folders)Package Method (flexible folders)Archived
INSERT, UPDATE, DELETE, SELECTdata_dmldata_dmlYes
GRANT, REVOKEsql_directdirectYes

Error Handling

Do not put error-handling statements in the SQL scripts. 

For SQL Server databases, do not include IF EXISTS statements with an object definition. 

Datical DB has its own error-handling that wraps SQL scripts. Specifying error-handling within the statements is not necessary.

Deployment Packager fails with an error if it encounters statements before an object definition.  


See also these pages for overview of packaging workflows, guidelines for writing scripts, and which packaging methods or folders to use for which types of changes:

Overview of Packaging

Writing SQL Scripts for Liquibase Enterprise

Fixed Folder Names

Flexible Folder Names

Copyright © Liquibase 2012-2022 - Proprietary and Confidential