With this blog I’m releasing the intial version of a python utility to provide automated db updates across various environments for different components.
The code for this utility is hosted on github
https://github.com/sandy724/ADU
You can clone the read only copy of this codebase by url given below
https://github.com/sandy724/ADU.git
To understand the basic idea about this utility go thorugh this blog
http://sandy4blogs.blogspot.in/2013/07/automated-db-updater.html
How to use this utility
Checkout the code at some directory, add the path of this directory in PYTHONPATH environment variable
Create a database with a script’s metadata table with given below ddl
CREATE TABLE `script_metadata` (
`name` varchar(100) DEFAULT NOT NULL,
`version` int(11) DEFAULT NOT NULL,
`executed` tinyint(1) NOT NULL DEFAULT ‘0’,
`env` varchar(30) DEFAULT NOT NULL,
`releas` varchar(30) DEFAULT NOT NULL,
`component` varchar(30) DEFAULT NOT NULL
)
Create a database.properties, containing connection properties of each environment database
Here common_db represents connection to database which will contain metadata of scripts for monitoring
Now execute the pythong utility
Copy the client(updateDB.py) to directory of your choice, make sure that property configration file should also be at this directory
python updateDB.py -f -r –env