Bugzilla – Attachment 23142 Details for
Bug 10855
Custom fields for subscriptions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10855: Update database entry
Bug-10855-Update-database-entry.patch (text/plain), 4.43 KB, created by
Jonathan Druart
on 2013-11-25 16:16:48 UTC
(
hide
)
Description:
Bug 10855: Update database entry
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-11-25 16:16:48 UTC
Size:
4.43 KB
patch
obsolete
>From 2a9bb89c68b29095ebf59840c908b27ad6c0cccb Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 29 Aug 2013 13:28:44 +0200 >Subject: [PATCH] Bug 10855: Update database entry > >Add 2 tables: additional_fields and additional_field_values >--- > installer/data/mysql/kohastructure.sql | 30 +++++++++++++++++++++++++ > installer/data/mysql/updatedatabase.pl | 38 +++++++++++++++++++++++++++++++- > 2 files changed, 67 insertions(+), 1 deletion(-) > >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index fefc985..437afd9 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3387,6 +3387,36 @@ CREATE TABLE IF NOT EXISTS marc_modification_template_actions ( > CONSTRAINT `mmta_ibfk_1` FOREIGN KEY (`template_id`) REFERENCES `marc_modification_templates` (`template_id`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8; > >+-- Table structure for table addition_fields >+-- This table add the ability to add new fields for a record >+-- >+ >+CREATE TABLE `additional_fields` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT, -- primary key identifier >+ `tablename` varchar(255) NOT NULL DEFAULT '', -- tablename of the new field >+ `name` varchar(255) NOT NULL DEFAULT '', -- name of the field >+ `authorised_value_category` varchar(16) NOT NULL DEFAULT '', -- is an authorised value category >+ `marcfield` varchar(16) NOT NULL DEFAULT '', -- contains the marc field to copied into the record >+ `searchable` tinyint(1) NOT NULL DEFAULT '0', -- is the field searchable? >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `fields_uniq` (`tablename`,`name`) >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ >+-- >+-- Table structure for table addition_field_values >+-- This table store values for additional fields >+-- >+ >+CREATE TABLE `additional_field_values` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT, -- primary key identifier >+ `field_id` int(11) NOT NULL, -- foreign key references addition_fields(id) >+ `record_id` int(11) NOT NULL, -- record_id >+ `value` varchar(255) NOT NULL DEFAULT '', -- value for this field >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `field_record` (`field_id`,`record_id`), >+ CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+) ENGINE=InnoDB DEFAULT CHARSET=utf8; >+ > /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; > /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; > /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 6162bc5..ddffdaf 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7130,7 +7130,6 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >- > $DBversion = "3.13.00.020"; > if ( CheckVersion($DBversion) ) { > $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')"); >@@ -7743,6 +7742,43 @@ if(CheckVersion($DBversion)) { > SetVersion($DBversion); > } > >+ >+ >+ >+ >+ >+ >+ >+ >+$DBversion = "3.13.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q| >+ CREATE TABLE `additional_fields` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT, >+ `tablename` varchar(255) NOT NULL DEFAULT '', >+ `name` varchar(255) NOT NULL DEFAULT '', >+ `authorised_value_category` varchar(16) NOT NULL DEFAULT '', >+ `marcfield` varchar(16) NOT NULL DEFAULT '', >+ `searchable` tinyint(1) NOT NULL DEFAULT '0', >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `fields_uniq` (`tablename`,`name`) >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 >+ |); >+ $dbh->do(q| >+ CREATE TABLE `additional_field_values` ( >+ `id` int(11) NOT NULL AUTO_INCREMENT, >+ `field_id` int(11) NOT NULL, >+ `record_id` int(11) NOT NULL, >+ `value` varchar(255) NOT NULL DEFAULT '', >+ PRIMARY KEY (`id`), >+ UNIQUE KEY `field_record` (`field_id`,`record_id`), >+ CONSTRAINT `afv_fk` FOREIGN KEY (`field_id`) REFERENCES `additional_fields` (`id`) ON DELETE CASCADE ON UPDATE CASCADE >+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 >+ |); >+ print "Upgrade to $DBversion done (Bug 10855: Add tables additional_fields and additional_field_values)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10855
:
20937
|
20938
|
20939
|
20940
|
20941
|
20942
|
20943
|
20944
|
21184
|
21185
|
21186
|
21187
|
21188
|
21189
|
21190
|
21191
|
21663
|
22049
|
22050
|
22051
|
22052
|
22053
|
22054
|
22055
|
22056
|
22057
|
22359
|
22360
|
22600
|
22601
|
22602
|
22603
|
22604
|
22605
|
22606
|
22607
|
22608
|
22616
|
22698
|
22699
|
22700
|
22701
|
22702
|
22703
|
22722
|
22768
|
22769
|
22869
|
23052
|
23053
|
23142
|
23143
|
23301
|
23302
|
23594
|
23595
|
23596
|
23597
|
23598
|
23599
|
23600
|
23601
|
23602
|
23774
|
23775
|
23961
|
23962
|
23963
|
23964
|
24452
|
24453
|
24454
|
24455
|
24456
|
24457
|
24569
|
24570
|
26091
|
26092
|
26093
|
26094
|
26095
|
26096
|
26097
|
26254
|
26255
|
26256
|
26257
|
26258
|
26259
|
26260
|
26276
|
26651
|
26655
|
28929
|
28930
|
28931
|
28932
|
28933
|
28934
|
28935
|
28936
|
28937
|
28938
|
28939
|
28940
|
28941
|
29095
|
29161
|
35211
|
35212
|
35213
|
35214
|
35215
|
35216
|
35217
|
35218
|
35219
|
35220
|
35221
|
35309
|
35310
|
35369
|
35556
|
36359
|
36362
|
36363
|
36364
|
36365
|
36366
|
36367
|
36368
|
36369
|
36370
|
36371
|
36372
|
36373
|
36374
|
38549
|
38550
|
38551
|
38552
|
38553
|
38554
|
38555
|
38556
|
38557
|
38558
|
38559
|
38560
|
38561
|
42296
|
42297
|
42298
|
42299
|
42300
|
42301
|
42302
|
42303
|
42304
|
42305
|
42306
|
42307
|
42308
|
42309
|
42310
|
42332
|
42333
|
43076