XML files containing one or more data fix sql statements, a sql statement to back up data, and validation statements used to determine whether the data fix should be committed or rolled back.
Object Type Identification
- If a file with .xml extension is in datafix folder, then it is considered a data fix file
File Extensions
Name | Description |
---|---|
.xml | Extensible Markup Language file format used to create common information formats and share both the format and the data using standard ASCII text. |
Object Type
Name | Code |
---|---|
Data Fix | DATA_FIX |
Object Type Attributes
Name | Code | Description | Required | Default Value | Supported Values |
---|---|---|---|---|---|
Source | SOURCE | Object source location type | Yes | SCM | SCM |
Target Location | TARGET_LOCATION | Path to where the file should be deployed to | No | ||
Database User Property | DB_USER | Property name for database user name | No | FDEBS_DB_USER | |
Database Password Property | DB_PASSWORD | Property name for database password | No | FDEBS_DB_PASSWORD |
Related Project Properties
Name | Code | Description | Default Value |
---|---|---|---|
Data Fix Root Source Directory | FDEBS_DATA_FIX_ROOT_SOURCE_DIR | The source directory to recognize files as data fixes | datafix |
Data Fix Root Destination Directory | FDEBS_DATA_FIX_DESTINATION_DIR | The destination directory to copy file to. Leave blank to not copy file anywhere |
Sample Build Commands
N/A - Build commands not supported for this type.
Sample Deploy Commands
N/A - Deploy commands not supported for this type.
Data Fix Source Formatting
Tag Name | Required | Description |
---|---|---|
Description | Yes | A description for the data fix being run |
FixSQL | Yes | The SQL which implements the data fix. It can be multiple statements delimited by a semicolon or slash |
BackupSQL | Yes | SQL to perform necessary backup of data before executing FixSQL |
ConnectString | Yes | The JDBC connection string for the database. Can also use environment instance property |
User | Yes | User to connect to database with. |
Password | Yes | Password for the database user. Must be a FlexDeploy property so it is not in clear text in file |
Validations | Yes | The rule(s) used to validate the data fix before committing changes |
Validation | Yes | A single validation rule. See below for more details |
A single validation contains the following:
Tag Name | Required | Description |
---|---|---|
Description | Yes | A description for the validation rule |
ValidationSQL | Yes | Select query which is executed before and after the FixSQL is executed, and result is compared with before and after values |
Environment | Yes | The expected results defined by an environment. See more info below |
An environment contains the following:
Tag Name | Required | Description |
---|---|---|
EnvironmentCode | Yes | FlexDeploy environment code, or DEFAULT to apply to any deploy environment not explicitly specified |
Before | No | Contains results to check before FixSQL is executed |
After | No | Contains results to check after FixSQL is executed |
UpdateCount | No | Results to compare return of JDBC executeUpdate() of FixSQL. If the FixSQL contains more than one statement, it is the sum of the updated rows |
The Before, After, and UpdateCount elements may contain one or more of the following operators to compare the result:
- Equals
- NotEquals
- LessThan
- LessThanEqual
- GreaterThan
- GreaterThanEqual
If more than one of these elements are present, all must evaluate to true for the validation to pass.
Data Fix XML Template
Basic Data Fix Template
<?xml version="1.0" encoding="UTF-8"?> <DataFix> <Description></Description> <FixSQL></FixSQL> <BackupSQL></BackupSQL> <!-- Database configuration will be replaced with environment/instance properties if left empty --> <ConnectString></ConnectString> <User></User> <Password></Password> <Validations> <Validation> <!-- Can be one or more --> <Description></Description> <ValidationSQL></ValidationSQL> <Environment> <EnvironmentCode></EnvironmentCode> <Before> <Equals></Equals> <NotEquals></NotEquals> <GreaterThan></GreaterThan> <GreaterThanEqual></GreaterThanEqual> <LessThan></LessThan> <LessThanEqual></LessThanEqual> </Before> <After> <LessThan></LessThan> </After> <UpdateCount> <Equals></Equals> </UpdateCount> </Environment> <Environment> <EnvironmentCode></EnvironmentCode> <UpdateCount> <GreaterThan></GreaterThan> </UpdateCount> </Environment> </Validation> </Validations> </DataFix>