yuniql icon indicating copy to clipboard operation
yuniql copied to clipboard

External .sql files for creating and configuring target database

Open rdagumampan opened this issue 5 years ago • 0 comments

When we call yuniql run, it checks if the database exists and pre-created it when --autocreate-db true is passed. It also configures the metadata table where schema versions are tracked and stored. This scripts are embedded in the yuniql build. This makes it difficult to customize if users want a custom behavior when creating databases in DEV or TEST environments.

A solution is to make these scripts as part of init directory. Such that we will have 2 files there 01-create-database.sql and 02-configure-database.sql. Users can also organize it this way.

_init
   - __dev
      - 01-create-database.sql
      - 02-configure-database.sql
   - __tests
      - 01-create-database.sql
      - 02-configure-database.sql

rdagumampan avatar Jan 22 '20 06:01 rdagumampan