Project Idea - Database Change Manager

Currently database used by the project gets created by load of a sqldump included in installation. To maintain an active installation, two update paths are provided :

  1. Version upgrade - Administrator chooses starting version and the script applies changes included in version upgrade set of files.
  2. Intermediate patch - Administrator can apply changes from a single file irrespective of version.

Idea behind this project would be to create alternate way to maintain database structures that mirrors and maintains development process. Since each change is brought in the codebase as pull request, project can require any database changes needed by that request be contained in a single file that include PR# as major node (e.g. 03878_xxxxxx.sql).

The change manager script will let administrator choose from specific directories that can contain sql files. Apart from DDL statements, the file may optionally contain list of PRs as dependency. Otherwise changes will be processed sequentially.

Processing of each file should be recorded in a table that will provide a running log of changes applied to the database. It will also aid in creating correct order of applying changes.

Unlike existing patch file structure, use of PR dependency will eliminate need for conditional execution mechanism. The PR sql file should be a set of plain DDL statements that should be applied unconditionally.

The script will also provide a way to get output of full database.sql for multiple uses.
Existing maintenance scripts should not be affected by this.

1 Like