* frameworks and itemtypes are independant

WARNING : will work only if applied to a 2.0 base. some modifs have been done since last commit that will NOT be applied if you run updatedatabase again.
This commit is contained in:
tipaul 2004-06-03 12:46:58 +00:00
parent afd4be5ddc
commit 1525f78ad6

View file

@ -212,6 +212,12 @@ my %requiretables = (
authtypecode char(10) not NULL,
authtypetext char(255) not NULL,
auth_tag_to_report char(3) not NULL,
PRIMARY KEY (authtypecode)
)",
biblio_framework => "(
frameworkcode char(4) not NULL,
frameworktext char(255) not NULL,
PRIMARY KEY (frameworkcode)
)",
auth_subfield_structure => "(
authtypecode char(10) NOT NULL default '',
@ -226,7 +232,7 @@ my %requiretables = (
value_builder char(80) default NULL,
seealso char(255) default NULL,
PRIMARY KEY (authtypecode,tagfield,tagsubfield),
KEY tab (tab)
KEY tab (authtypecode,tab)
)",
auth_tag_structure => "(
authtypecode char(10) NOT NULL default '',
@ -246,7 +252,7 @@ my %requiretables = (
PRIMARY KEY (authid),
KEY origincode (origincode),
) ",
marc_subfield_table => "(
auth_subfield_table => "(
subfieldid bigint(20) unsigned NOT NULL auto_increment,
authid bigint(20) unsigned NOT NULL default '0',
tag char(3) NOT NULL default '',
@ -322,15 +328,16 @@ my %requirefields = (
'options' => 'text' },
z3950servers => { 'syntax' => 'char(80)' },
marc_tag_structure =>{
'itemtype' => 'char(4) not NULL default \'\''},
'frameworkcode' => 'char(4) not NULL default \'\''},
marc_subfield_structure =>{'seealso' => 'char(255)',
'itemtype' => 'char(4) not NULL default \'\'',
'frameworkcode' => 'char(4) not NULL default \'\'',
'hidden' => 'tinyint(1)',
'isurl' => 'tinyint(1)',
},
bookshelf => {'owner' => 'char(80)',
'category' => 'char(1)',
},
marc_biblio => { 'frameworkcode' => 'char(4) not NULL default \'\'' },
);
my %dropable_table = (
@ -665,6 +672,15 @@ my %tabledata = (
explanation => 'if set to 1, suggestions are activated in OPAC',
type => 'free'
},
{
uniquefieldrequired => 'variable',
variable => 'ISBD',
forceupdate => { 'explanation' => 1,
'type' => 1 },
value => 'Fill with appropriate value...',
explanation => 'ISBD',
type => 'free'
},
],
);
@ -1001,6 +1017,13 @@ $dbh->do("ALTER TABLE `marc_breeding` CHANGE `z3950random` `z3950random` VARCHAR
# making borrowernumber an auto_increment field
$dbh->do("ALTER TABLE `borrowers` CHANGE `borrowernumber` `borrowernumber` INTEGER auto_increment");
# changing indexes in marc_*_structure to use frameworkcode
$dbh->do('alter table marc_subfield_structure drop index tab');
$dbh->do('create index tab on marc_subfield_structure (frameworkcode,tab)');
$dbh->do('alter table marc_subfield_structure drop index kohafield');
$dbh->do('create index kohafield on marc_subfield_structure (frameworkcode,kohafield)');
# extending the timestamp in branchtransfers...
my %branchtransfers;
@ -1104,10 +1127,10 @@ print "Creating index on z3950results\n" unless $exists;
$dbh->do('ALTER TABLE issuingrules ADD PRIMARY KEY ( branchcode, categorycode, itemtype )') unless $exists;
$dbh->do('ALTER TABLE marc_tag_structure drop primary key');
$dbh->do('ALTER TABLE marc_tag_structure ADD PRIMARY KEY ( itemtype, tagfield )');
$dbh->do('ALTER TABLE marc_tag_structure ADD PRIMARY KEY ( frameworkcode, tagfield )');
$dbh->do('ALTER TABLE marc_subfield_structure drop primary key');
$dbh->do('ALTER TABLE marc_subfield_structure ADD PRIMARY KEY ( itemtype, tagfield, tagsubfield )');
$dbh->do('ALTER TABLE marc_subfield_structure ADD PRIMARY KEY ( frameworkcode, tagfield, tagsubfield )');
# Populate tables with required data
@ -1160,6 +1183,11 @@ $sth->finish;
exit;
# $Log$
# Revision 1.82 2004/06/03 12:46:58 tipaul
# * frameworks and itemtypes are independant
#
# WARNING : will work only if applied to a 2.0 base. some modifs have been done since last commit that will NOT be applied if you run updatedatabase again.
#
# Revision 1.81 2004/05/28 09:56:21 tipaul
# bugfix
#