apply-sql-patch applies an sql patch and adds revision control information to a database
[slim.amamou.scripts.git] / apply-sql-patch
blobb95136bc98d251815062b59b060c1923d0b4b547
1 #!/bin/sh
3 # applies SQL patch to a database and inserts a revision control entry in the
4 # database.
6 patch=$1
7 db=markkit
8 db_user=root
10 ctrl_patch_query="insert into ctrl_patch values ('', '$patch')"
12 cat $patch
13 mysql -u $db_user $db < $patch
14 echo $ctrl_patch_query
15 echo $ctrl_patch_query | mysql -u $db_user $db