Versions Compared

Key

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

...

Checking your code into SCM

File structure

The file structure is typically as follow:

...

  • portal_sql is the name of your repository, 
  • sql_code is the name of the directory where the packager will look for new/modified .sql files to package, this directory is reference in the deployPackager.properties in your DaticalDB project
  • the sub-directories represent the different kinds of SQL scripts to package. The process order for a commit is the following: ddl, sqlplus, sql, function, packagebody, package, procedure and finally data_dml

metadata.properties

In each directory under the top level one (sql_code in this example), you can create configuration file named metadata, where you can pass some additional directives to the packager (like additional label or context)

Git

For a complete understanding of Git please refer to the official documentation.

  1. Get the latest version for the code
    1. "git clone" (the first time)
    2. or "git pull" if your local repository already exist
  2. change to the correct branch
    1. "git checkout branch_name"
  3. create files in the correct subdirectories (you may have to create the subdirectory first) as required
  4. add the files to your upcoming commit with: "git add <filename> ..." or "git add ." to commit the whole current directory and its children.
  5. Commit the files you have added with :
    git commit -m "Commit message" 
    if the commit message contains some text between square bracket like "Create employee table [JIRA-1234]", a "label" will be automatically created by DaticalDB during the deployer phase. This allows you to add additional label for specific jira, feature, story, ... for a more granular deployment process
  6. if you need to insert some kind of orders to process you files (i.e. CREATE the table before the ALTER statement), you can split you git add and git commit as in
    1. git add createEmployeeTable.sql
    2. git commit -m "Create employee table"
    3. git add AlterEmployeeTable.sql
    4. git commit -m "Add a column to the employee table [JIRA-2345]"
  7. Push your changes to the git server so the packager (and your colleagues) can have access to the changes:
    1. git push 

...