@@ -, +, @@ --- installer/data/mysql/atomicupdate/skeleton.perl | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) --- a/installer/data/mysql/atomicupdate/skeleton.perl +++ a/installer/data/mysql/atomicupdate/skeleton.perl @@ -1,10 +1,14 @@ -use C4::Installer; -my $dbh = C4::Context->dbh; -$DBversion = '16.06.00.XXX'; -if (C4::Context->preference("Version") < TransformToNum($DBversion)) { - unless( column_exists( 'biblio', 'biblionumber' ) ) { # or constraint_exists( $table_name, $key_name ) - warn "There is something wrong"; - } - SetVersion ($DBversion); +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + # you can use $dbh here like: + # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" ); + + # or perform some test and warn + # if( !column_exists( 'biblio', 'biblionumber' ) ) { + # warn "There is something wrong"; + # } + + # Always end with this (adjust the bug info) + SetVersion( $DBversion ); print "Upgrade to $DBversion done (Bug XXXXX - description)\n"; } --