Update of /cvsroot/koha/koha/updater In directory usw-pr-cvs1:/tmp/cvs-serv15441/updater Modified Files: updatedatabase Log Message: moredetail.pl presents circulation information taken from the branchtransfers table Circ2.pm has been changed a little admin/branches.pl alows branches to be added, edited and deleted. updatedatabase needs more fixing Index: updatedatabase =================================================================== RCS file: /cvsroot/koha/koha/updater/updatedatabase,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -r1.4 -r1.5 *** updatedatabase 26 Mar 2002 05:08:52 -0000 1.4 --- updatedatabase 2 May 2002 00:08:53 -0000 1.5 *************** *** 138,156 **** print "Setting type of categorycode in branchcategories to varchar(4),\n and making the primary key.\n"; my $sti=$dbh->prepare("alter table branchcategories change categorycode categorycode varchar(4) not null"); ! $sti->execute; ! $sti=$dbh->prepare("alter table branchcategories add primary key (categorycode)"); ! $sti->execute; } unless ($branchcategories{'branchcode'} eq 'varchar(4)') { ! print "Setting type of branchcode in branchcategories to varchar(4).\n"; ! my $sti=$dbh->prepare("alter table branchcategories change branchcode branchcode varchar(4)"); ! $sti->execute; } unless ($branchcategories{'codedescription'} eq 'text') { print "Replacing branchholding in branchcategories with codedescription text.\n"; ! my $sti=$dbh->prepare("alter table branchcategories change branchholding codedescription text"); ! $sti->execute; } --- 138,173 ---- print "Setting type of categorycode in branchcategories to varchar(4),\n and making the primary key.\n"; my $sti=$dbh->prepare("alter table branchcategories change categorycode categorycode varchar(4) not null"); ! $sth->execute; ! $sth=$dbh->prepare("alter table branchcategories add primary key (categorycode)"); ! $sth->execute; } unless ($branchcategories{'branchcode'} eq 'varchar(4)') { ! print "Changing branchcode in branchcategories to categoryname text.\n"; ! my $sth=$dbh->prepare("alter table branchcategories change branchcode categoryname text"); ! $sth->execute; } unless ($branchcategories{'codedescription'} eq 'text') { print "Replacing branchholding in branchcategories with codedescription text.\n"; ! my $sth=$dbh->prepare("alter table branchcategories change branchholding codedescription text"); ! $sth->execute; ! } ! ! # Create new branchrelations table if it doesnt already exist.... ! my $branchrelationsexists; ! ! my $sth=$dbh->prepare("show tables"); ! $sth->execute; ! while (my ($tablename) = $sth->fetchrow) { ! if ($tablename == "branchrelations") { ! $branchrelationsexists = 1; ! } ! } ! ! unless ($branchrelationsexists) { ! print "creating branchrelations table"; ! my $sth->prepare("create table branchrelations (branchcode varchar(4), categorycode varchar(4))"); ! $sth->execute; }