Versions Compared

Key

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

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

...

NameCodeDescriptionDefault Value
Data Fix Root Source DirectoryFDEBS_DATA_FIX_ROOT_SOURCE_DIRThe source directory to recognize files as data fixesdatafix
Data Fix Root Destination DirectoryFDEBS_DATA_FIX_DESTINATION_DIRThe 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.

...

Data Fix Source Formatting

Tag NameRequiredDescription
DescriptionYesA description for the data fix being run
FixSQLYesThe SQL which implements the data fix. It can be multiple statements delimited by a semicolon or slash
BackupSQLYesSQL to perform necessary backup of data before executing FixSQL
ConnectStringYesThe JDBC connection string for the database. Can also use environment instance property
UserYesUser to connect to database with. 
PasswordYesPassword for the database user. Must be a FlexDeploy property so it is not in clear text in file
ValidationsYesThe rule(s) used to validate the data fix before committing changes
       ValidationYesA single validation rule. See below for more details

A single validation contains the following:

Tag NameRequiredDescription
DescriptionYesA description for the validation rule
ValidationSQLYesSelect query which is executed before and after the FixSQL is executed, and result is compared with before and after values
EnvironmentYesThe expected results defined by an environment. See more info below

An environment contains the following:

Tag NameRequiredDescription
EnvironmentCodeYesFlexDeploy environment code, or DEFAULT to apply to any deploy environment not explicitly specified
BeforeNoContains results to check before FixSQL is executed
AfterNoContains results to check after FixSQL is executed
UpdateCountNoResults 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:

...

Code Block
languagexml
themeRDark
titleBasic Data Fix Template
linenumberstrue
<?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>

...