Updates to Manage Vehicles DB schema and DB version management process #85
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
DDL for Manage Vehicles, previously stored in /database/mssql/ddl/sample_ddl.sql has been moved into /database/mssql/scripts/versions/ directory.
DDL is implemented as individual DDL script files to be applied in sequential order, starting at version 1 and up to version x, where x is the most recent version of the ORBC database. Individual script files are named according to a pattern recognized by the sql server container startup shell script. Comments are in the shell scripts, located at /database/mssql/*.sh.
This is the first step towards allowing us to normalize the process required to keep the SQL Server databases in sync between dev, test, and production. Also, it is compatible with the standard MOTI process for incrementing production database versions with incremental script file executions.
Note this commit requires that developers use a local .env file to store environment variable secrets (and other not-quite-so-secret configuration). Details of the .env file have been posted to the devs MS Teams conversation.
Fixes # (issue)
Type of change
How Has This Been Tested?
Checklist
Further comments
The versioning approach was influenced by the TypeORM migrations pattern, but allows for compatibility with MOTI database standards. MOTI DBAs will be responsible for executing DDL for each version upgrade in production, and they require SQL DDL instead of TypeScript or JavaScript which TypeORM migrations use.
Manually creating DDL instead of using TypeORM to generate DDL for us allows us to include additional required elements such as table and column comments, and allows us to be flexible with respect to the data types we use.
Thanks for the PR!
Any successful deployments (not always required) will be available below.
Backend available
Frontend available
Once merged, code will be promoted and handed off to following workflow run.
Main Merge Workflow