Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
This feature is available in version 5.0 and later. 


Using Flexible Folders

This feature can help you if you cannot use fixed-name folders in SCM under a <sql_code> root. 

...

OrderSQLFileTypepackageMethod
1ddlCONVERT
2ddl_directDDL_DIRECT
3viewSTOREDLOGIC
4ssisSSIS
5ssis_project

SSIS

6functionSTOREDLOGIC
7procedureSTOREDLOGIC
8packageSTOREDLOGIC
9packagebodySTOREDLOGIC
10triggerSTOREDLOGIC
11sqlSQLFILE
12sqlplusDIRECT
13sql_directDIRECT
14data_dmlDATA_DML

...

Normally DDL changes are placed in folders that use the CONVERT packaging method. However, when you need to package complex and interdependent changes, place them in a folder that uses the DDL_DIRECT or DIRECT packaging method instead. 

If the order that the multiple statements are listed in the single script is critical to the success of the script, then use the DDL_DIRECT or DIRECT packaging method. The DDL_DIRECT or DIRECT packaging method will preserve the order of the statements in the script. (The CONVERT packaging method may not preserve the order because it creates the change sets by doing a diff of before and after snapshots, and that comparison process does not know the original order of the statements.)

...

SQLFileTypeResources folder
DDLN/A
DDL_DIRECTddl_direct
VIEWview
SSISssis
SSIS_PROJECTssis_project
FUNCTIONfunction
PROCEDUREprocedure
PACKAGEpackage
PACKAGEBODYpackagebody
TRIGGERtrigger
SQLsql
SQLPLUSsql
SQL_DIRECTsql
DATA_DMLdata_dml

...

  • Folders containing metadata.properties file are processed.
  • Folders not containing metadata.properties file are skipped.

...

Available properties for metadata.properties

A full list of the properties that can be defined in metadata.properties filesis found hereUsing the metadata.properties file

Some of the most commonly used properties are mentioned below:

ignore

Set to true or false. If true, packager skips this folder and all subfolders during processing. 

packageMethod

If specified, determines the processing method to use during packaging. The file is further parsed to determine the SQLFileType, which determines the order of processing. 

...

  • CONVERT (convert)
  • STOREDLOGIC (native)
  • DIRECT (native)
  • DDL_DIRECT (native)
  • DATA_DML (native)
  • SQLFILE (native)
  • SSIS (native)

rerunnable

Important: The newer rerunnable property replaces two properties in metadata.properties.  These older properties that are are deprecated and should not no longer be used :(allowRepackaging

...

and archive).

Set rerunnable to true or false.:

  • true - the SQL code file is not archived. It can be repackaged. 
  • false - the SQL code file is archived. It cannot be repackaged. 

If not set, packager checks whether fixed-name folders are being used under the <sql_code> root and assigns the default rerunnable property value as follows. In general, stored logic is rerunnable. 

Fixed FolderRerunnable default setting
ddlfalse
ddl_directfalse
data_dmlfalse
sql_direct

false

sqlfalse
sqlplusfalse
proceduretrue
packagetrue
packagebodytrue
functiontrue
triggertrue
viewtrue

versionStrategy

When you are using the rerunnable=true property, you can have multiple versions of the change set for different iterations of the sql script.  Stored Logic is usually configured to use rerunnable=true.  You can then use the versionStrategy property to indicate whether to deploy all versions of the rerunnable change set, or only deploy the latest version of the rerunnable change set.

Set versionStrategy to deployAll or deployLatest:

  • deployAll - deploy all eligible versions in the order they appear in changelog.xml. This is the default.
  • deployLatest - deploy only the latest eligible version.


See also these pages for an overview of packager workflows, guidelines for writing scripts, and when to use which folder or packaging method:

...

SQL Server Database Objects and Packaging

Fixed Folder Names

Using the metadata.properties file

How To: Choose Between CONVERT (ddl) and DDL_DIRECT (ddl_direct) Packaging Methods

...