View | Details | Raw Unified | Return to bug 6536
Collapse All | Expand All

(-)a/installer/data/mysql/kohastructure.sql (-4 / +6 lines)
Lines 1985-2005 CREATE TABLE `virtualshelfcontents` ( Link Here
1985
1985
1986
DROP TABLE IF EXISTS `z3950servers`;
1986
DROP TABLE IF EXISTS `z3950servers`;
1987
CREATE TABLE `z3950servers` (
1987
CREATE TABLE `z3950servers` (
1988
  `host` varchar(255) default NULL,
1988
  `host` varchar(255) NOT NULL,
1989
  `port` int(11) default NULL,
1989
  `port` int(11) default NULL,
1990
  `db` varchar(255) default NULL,
1990
  `db` varchar(255) default NULL,
1991
  `userid` varchar(255) default NULL,
1991
  `userid` varchar(255) default NULL,
1992
  `password` varchar(255) default NULL,
1992
  `password` varchar(255) default NULL,
1993
  `name` mediumtext,
1993
  `name` mediumtext NOT NULL,
1994
  `id` int(11) NOT NULL auto_increment,
1994
  `id` int(11) NOT NULL auto_increment,
1995
  `checked` smallint(6) default NULL,
1995
  `checked` smallint(6) default NULL,
1996
  `rank` int(11) default NULL,
1996
  `rank` int(11) default NULL,
1997
  `syntax` varchar(80) default NULL,
1997
  `syntax` varchar(80) NOT NULL,
1998
  `icon` text,
1998
  `icon` text,
1999
  `position` enum('primary','secondary','') NOT NULL default 'primary',
1999
  `position` enum('primary','secondary','') NOT NULL default 'primary',
2000
  `type` enum('zed','opensearch') NOT NULL default 'zed',
2000
  `type` enum('zed','opensearch') NOT NULL default 'zed',
2001
  `encoding` text default NULL,
2001
  `encoding` text NOT NULL,
2002
  `description` text NOT NULL,
2002
  `description` text NOT NULL,
2003
  `srufields` text,
2004
  `add_xslt` varchar(255),
2003
  PRIMARY KEY  (`id`)
2005
  PRIMARY KEY  (`id`)
2004
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2006
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
2005
2007
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +19 lines)
Lines 4354-4359 if (C4::Context->preference("Version") < TransformToNum($DBversion)) { Link Here
4354
    SetVersion ($DBversion);
4354
    SetVersion ($DBversion);
4355
}
4355
}
4356
4356
4357
$DBversion = "3.05.00.XXX";
4358
if (C4::Context->preference("Version") lt TransformToNum($DBversion)) {
4359
  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `host` varchar(255) NOT NULL;");
4360
  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `name` mediumtext NOT NULL;");
4361
  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `syntax` varchar(80) NOT NULL;");
4362
  $dbh->do("ALTER TABLE z3950servers MODIFY COLUMN `encoding` text NOT NULL;");
4363
  $dbh->do("ALTER TABLE z3950servers ADD COLUMN `srufields` text;");
4364
  $dbh->do("ALTER TABLE z3950servers ADD COLUMN `add_xslt` varchar(255);");
4365
  print "Upgrade to $DBversion done (Bug 6536: Z3950 enhancements)\n";
4366
  SetVersion ($DBversion);
4367
}
4368
4357
=head1 FUNCTIONS
4369
=head1 FUNCTIONS
4358
4370
4359
=head2 DropAllForeignKeys($table)
4371
=head2 DropAllForeignKeys($table)
Lines 4396-4401 sub TransformToNum { Link Here
4396
    my $version = shift;
4408
    my $version = shift;
4397
    # remove the 3 last . to have a Perl number
4409
    # remove the 3 last . to have a Perl number
4398
    $version =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
4410
    $version =~ s/(.*\..*)\.(.*)\.(.*)/$1$2$3/;
4411
    # three X's at the end indicate that you are testing patch with dbrev
4412
    # change it into 999
4413
    # prevents error on a < comparison between strings (should be: lt)
4414
    $version =~ s/XXX$/999/;
4399
    return $version;
4415
    return $version;
4400
}
4416
}
4401
4417
Lines 4406-4412 set the DBversion in the systempreferences Link Here
4406
=cut
4422
=cut
4407
4423
4408
sub SetVersion {
4424
sub SetVersion {
4409
    my $kohaversion = TransformToNum(shift);
4425
    return if $_[0]=~ /XXX$/;
4426
      #you are testing a patch with a db revision; do not change version
4427
    my $kohaversion = TransformToNum($_[0]);
4410
    if (C4::Context->preference('Version')) {
4428
    if (C4::Context->preference('Version')) {
4411
      my $finish=$dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='Version'");
4429
      my $finish=$dbh->prepare("UPDATE systempreferences SET value=? WHERE variable='Version'");
4412
      $finish->execute($kohaversion);
4430
      $finish->execute($kohaversion);
4413
- 

Return to bug 6536