3 # applies SQL patch to a database and inserts a revision control entry in the
6 # apply-sql-patch (without arguments)
7 # prints sql statements to initialise the datbase
8 # apply-sql-patch <patch-file>
9 # applies the patch to the database
13 create table ctrl_patch (id integer auto_increment primary key, time timestamp, name varchar(128) unique);
14 insert into ctrl_patch values (NULL,NULL, 'patch-create-ctrl_patch.sql');
23 ctrl_patch_query
="insert into ctrl_patch values (NULL,NULL, '$patch')"
26 mysql
-u $db_user $db < $patch
27 echo $ctrl_patch_query
28 echo $ctrl_patch_query | mysql
-u $db_user $db