Archive for the ‘Default’ Category
How to organize Version Control for database development
One lite practicable idea for organizing version control tree for database development is presented below:
The example of the svn tree is presented below:
/svn
/features
/user
/enable
create_user.sql
create_user_permissions.sql
pkg_user.pkb
pkg_user.pks
/disable
drop_user.sql
drop_user_permissions.sql
/comments
...
/scripts
create_user_all.php
drop_user_all.php
recreate_database.php
The root directory consists of “features” and “scripts” dirs:
- Features – Logical functional units; a list of features we have (for example, a user or comments)
- Each feature can be divided into “enable” and “disable” SQL scripts
- Each enable/disable dir consists of the list of SQL scripts
- Each feature can be divided into “enable” and “disable” SQL scripts
- Scripts – List of scripts (php/perl/bash etc) that aggregate the features files into one sql file. The output of the script is the SQL file that contains all the SQL statements you need to enable/disable the feature.
DB developers work result is a list of SQL and pl/bash scripts for different variations (e.g. creates for empty db, patches et.
/svn
/features
/user
/enable
create_user.sql
create_user_permissions.sql
pkg_user.pkb
pkg_user.pks
/disable
drop_user.sql
drop_user_permissions.sql
/comments
…
/scripts
create_user_all.php
drop_user_all.php
recreate_database.php
/features
/user
/enable
create_user.sql
create_user_permissions.sql
pkg_user.pkb
pkg_user.pks
/disable
drop_user.sql
drop_user_permissions.sql
/comments
…
/scripts
create_user_all.php
drop_user_all.php
recreate_database.php