From d1401f79387f593aa1b7b835f796e21512d3b6a1 Mon Sep 17 00:00:00 2001 From: Chris Nighswonger Date: Sat, 1 Mar 2008 09:28:34 +1300 Subject: [PATCH] Checking the existing database for the existence of labels_template table and adding it if it does NOT exist already. Signed-off-by: Chris Cormack Signed-off-by: Joshua Ferraro --- installer/data/mysql/updatedatabase.pl | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 2d0d083d58..0ab40e2913 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -1058,6 +1058,31 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) { SetVersion ($DBversion); } +$DBversion = "3.00.00.058"; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + + $dbh->do("CREATE TABLE IF NOT EXISTS `labels_templates` ( + `tmpl_id` int(4) NOT NULL auto_increment, + `tmpl_code` char(100) default '', + `tmpl_desc` char(100) default '', + `page_width` float default '0', + `page_height` float default '0', + `label_width` float default '0', + `label_height` float default '0', + `topmargin` float default '0', + `leftmargin` float default '0', + `cols` int(2) default '0', + `rows` int(2) default '0', + `colgap` float default '0', + `rowgap` float default '0', + `active` int(1) default NULL, + `units` char(20) default 'PX', + `fontsize` int(4) NOT NULL default '3', + PRIMARY KEY (`tmpl_id`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8;"); + print "Upgrade to $DBversion done ( Added labels_templates table if it did not exist. )\n"; + SetVersion ($DBversion); +} $DBversion = "3.00.00.058"; if (C4::Context->preference("Version") < TransformToNum($DBversion)) { -- 2.39.5