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 <chris@bigballofwax.co.nz>
Signed-off-by: Joshua Ferraro <jmf@liblime.com>
This commit is contained in:
Chris Nighswonger 2008-03-01 09:28:34 +13:00 committed by Joshua Ferraro
parent 6deddfb7bd
commit d1401f7938

View file

@ -1058,6 +1058,31 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
SetVersion ($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"; $DBversion = "3.00.00.058";
if (C4::Context->preference("Version") < TransformToNum($DBversion)) { if (C4::Context->preference("Version") < TransformToNum($DBversion)) {