Versions Compared

Key

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

...

  1. Setup directory structure such that there are context-specific subdirectories in EACH of the sql_code directories (data_dml, ddl, ddl_direct, function, package, packagebody, procedure, sql, sql_direct, trigger, and view)
    • For example, in data_dml directory, there would be three DEV directories - one for each DEV environment - DEV1, DEV2 and DEV3
    • In each of the subdirectories, there would be a "metadata.properties" file which would contain "contexts" flag:
      • In PROD-only subdirectory, the "metadata.properties" file would contain "contexts=PROD"
      • In STAGE-only subdirectory, the "metadata.properties" file would contain "contexts=STAGE"
      • In QA-only subdirectory, the "metadata.properties" file would contain "contexts=QA"
      • In DEV-only subdirectory, the "metadata.properties" file would contain "contexts=DEV"
      • In REF1-only subdirectory, the "metadata.properties" file would contain "contexts=REF1"
      • In until-DEV subdirectory, the "metadata.properties" file would contain "contexts=REF1,DEV"
      • In until-QA subdirectory, the "metadata.properties" file would contain "contexts=REF1,DEV,QA"
      • In until-STAGE subdirectory, the "metadata.properties" file would contain "contexts=REF1,DEV,QA,STAGE"
  2. Database developer commits scripts into the appropriate subdirectory. 
    • For example, if a DML script only needs to be deployed into QA environment, then the developer would commit that scripts into the following subdirectory:
      • sql_code → data_dml → QA-only
  3. When the packager picks up scripts from this subdirectory (e.g., sql_code\data_dml\QA-only), it will automatically apply the "QA" context to resulting changsets.
    • Let's say "customer_billing_SEPT.sql" script is committed into sql_code\data_dml\QA-only subdirectory
    • When packager runs, it will pick up this script and realize that there is a metadata.properties file located in the same subdirectory and it contains contexts=QA. Therefore, packager will apply this context to all changesets generated from this sql script
    • Now, when you deploy your changes to QA environment, these changesets will be DEPLOYED.
    • When you deploy your changes to other environments (DEV, STAGE or PROD), these changesets will be SKIPPED because the context for these changesets do not match with the database context as specified in the Datical project.

...