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

(-)a/installer/data/mysql/kohastructure.sql (+31 lines)
Lines 3387-3392 CREATE TABLE IF NOT EXISTS marc_modification_template_actions ( Link Here
3387
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3387
  CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE
3388
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3388
) ENGINE=InnoDB  DEFAULT CHARSET=utf8;
3389
3389
3390
--
3391
-- Table structure for table additional_fields
3392
-- This table add the ability to add new fields for a record
3393
--
3394
3395
CREATE TABLE `additional_fields` (
3396
  `id` int(11) NOT NULL AUTO_INCREMENT, -- primary key identifier
3397
  `tablename` varchar(255) NOT NULL DEFAULT '', -- tablename of the new field
3398
  `name` varchar(255) NOT NULL DEFAULT '', -- name of the field
3399
  `authorised_value_category` varchar(16) NOT NULL DEFAULT '', -- is an authorised value category
3400
  `marcfield` varchar(16) NOT NULL DEFAULT '', -- contains the marc field to copied into the record
3401
  `searchable` tinyint(1) NOT NULL DEFAULT '0', -- is the field searchable?
3402
  PRIMARY KEY (`id`),
3403
  UNIQUE KEY `fields_uniq` (`tablename`,`name`)
3404
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3405
3406
--
3407
-- Table structure for table additional_field_values
3408
-- This table store values for additional fields
3409
--
3410
3411
CREATE TABLE `additional_field_values` (
3412
  `id` int(11) NOT NULL AUTO_INCREMENT, -- primary key identifier
3413
  `field_id` int(11) NOT NULL, -- foreign key references additional_fields(id)
3414
  `record_id` int(11) NOT NULL, -- record_id
3415
  `value` varchar(255) NOT NULL DEFAULT '', -- value for this field
3416
  PRIMARY KEY (`id`),
3417
  UNIQUE KEY `field_record` (`field_id`,`record_id`),
3418
  CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
3419
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3420
3390
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3421
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3391
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3422
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3392
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3423
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +36 lines)
Lines 7130-7136 if ( CheckVersion($DBversion) ) { Link Here
7130
    SetVersion($DBversion);
7130
    SetVersion($DBversion);
7131
}
7131
}
7132
7132
7133
7134
$DBversion = "3.13.00.020";
7133
$DBversion = "3.13.00.020";
7135
if ( CheckVersion($DBversion) ) {
7134
if ( CheckVersion($DBversion) ) {
7136
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
7135
    $dbh->do("INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES('WhenLostForgiveFine','0',NULL,'If ON, Forgives the fines on an item when it is lost.','YesNo')");
Lines 7778-7783 if(CheckVersion($DBversion)) { Link Here
7778
    SetVersion($DBversion);
7777
    SetVersion($DBversion);
7779
}
7778
}
7780
7779
7780
7781
7782
7783
7784
7785
7786
7787
$DBversion = "3.13.00.XXX";
7788
if ( CheckVersion($DBversion) ) {
7789
    $dbh->do(q|
7790
        CREATE TABLE `additional_fields` (
7791
          `id` int(11) NOT NULL AUTO_INCREMENT,
7792
          `tablename` varchar(255) NOT NULL DEFAULT '',
7793
          `name` varchar(255) NOT NULL DEFAULT '',
7794
          `authorised_value_category` varchar(16) NOT NULL DEFAULT '',
7795
          `marcfield` varchar(16) NOT NULL DEFAULT '',
7796
          `searchable` tinyint(1) NOT NULL DEFAULT '0',
7797
          PRIMARY KEY (`id`),
7798
          UNIQUE KEY `fields_uniq` (`tablename`,`name`)
7799
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
7800
    |);
7801
    $dbh->do(q|
7802
        CREATE TABLE `additional_field_values` (
7803
          `id` int(11) NOT NULL AUTO_INCREMENT,
7804
          `field_id` int(11) NOT NULL,
7805
          `record_id` int(11) NOT NULL,
7806
          `value` varchar(255) NOT NULL DEFAULT '',
7807
          PRIMARY KEY (`id`),
7808
          UNIQUE KEY `field_record` (`field_id`,`record_id`),
7809
          CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
7810
        ) ENGINE=InnoDB DEFAULT CHARSET=utf8
7811
    |);
7812
    print "Upgrade to $DBversion done (Bug 10855: Add tables additional_fields and additional_field_values)\n";
7813
    SetVersion($DBversion);
7814
}
7815
7781
=head1 FUNCTIONS
7816
=head1 FUNCTIONS
7782
7817
7783
=head2 TableExists($table)
7818
=head2 TableExists($table)
7784
- 

Return to bug 10855