Bugzilla – Attachment 110342 Details for
Bug 26145
Add the ability to attach a cover image at item level
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 26145: DB changes - Add biblioimages.imagenumber
Bug-26145-DB-changes---Add-biblioimagesimagenumber.patch (text/plain), 2.97 KB, created by
Jonathan Druart
on 2020-09-18 10:22:35 UTC
(
hide
)
Description:
Bug 26145: DB changes - Add biblioimages.imagenumber
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2020-09-18 10:22:35 UTC
Size:
2.97 KB
patch
obsolete
>From e7dd30075d167c0d01ddcbef2722e677e55b204a Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 28 Jul 2020 21:13:01 +0200 >Subject: [PATCH] Bug 26145: DB changes - Add biblioimages.imagenumber > >Sponsored-by: Gerhard Sondermann Dialog e.K. (presseplus.de, presseshop.at, presseshop.ch) >--- > .../data/mysql/atomicupdate/bug_xxxxx.perl | 20 +++++++++++++++++++ > installer/data/mysql/kohastructure.sql | 6 ++++-- > 2 files changed, 24 insertions(+), 2 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_xxxxx.perl > >diff --git a/installer/data/mysql/atomicupdate/bug_xxxxx.perl b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >new file mode 100644 >index 0000000000..46e0614381 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_xxxxx.perl >@@ -0,0 +1,20 @@ >+$DBversion = 'XXX'; # will be replaced by the RM >+if( CheckVersion( $DBversion ) ) { >+ >+ if( !column_exists( 'biblioimages', 'itemnumber' ) ) { >+ $dbh->do(q| >+ ALTER TABLE biblioimages >+ ADD COLUMN itemnumber INT(11) DEFAULT NULL >+ AFTER biblionumber; >+ |); >+ $dbh->do(q| >+ ALTER TABLE biblioimages >+ ADD FOREIGN KEY bibliocoverimage_fk2 (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ |); >+ $dbh->do(q| >+ ALTER TABLE biblioimages MODIFY biblionumber INT(11) DEFAULT NULL >+ |) >+ } >+ >+ NewVersion( $DBversion, 'XXXXX', "Add the biblioimages.itemnumber column"); >+} >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index 572a56310c..fec12b7f0f 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3374,13 +3374,15 @@ DROP TABLE IF EXISTS `biblioimages`; > > CREATE TABLE `biblioimages` ( -- local cover images > `imagenumber` int(11) NOT NULL AUTO_INCREMENT, -- unique identifier for the image >- `biblionumber` int(11) NOT NULL, -- foreign key from biblio table to link to biblionumber >+ `biblionumber` int(11) DEFAULT NULL, -- foreign key from biblio table to link to biblionumber >+ `itemnumber` int(11) DEFAULT NULL, -- foreign key from item table to link to itemnumber > `mimetype` varchar(15) NOT NULL, -- image type > `imagefile` mediumblob NOT NULL, -- image file contents > `thumbnail` mediumblob NOT NULL, -- thumbnail file contents > `timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, -- image creation/update time > PRIMARY KEY (`imagenumber`), >- CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE >+ CONSTRAINT `bibliocoverimage_fk1` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE, >+ CONSTRAINT `bibliocoverimage_fk2` FOREIGN KEY (`itemnumber`) REFERENCES `item` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE > ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; > > -- >-- >2.20.1
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 26145
:
109225
|
109226
|
110342
|
110343
|
110344
|
110345
|
110346
|
110347
|
110348
|
110349
|
110350
|
110351
|
110352
|
110353
|
110354
|
110675
|
110676
|
110677
|
110678
|
110679
|
110680
|
110681
|
110682
|
110683
|
110684
|
110685
|
110800
|
110861
|
110862
|
110863
|
110864
|
110865
|
110866
|
110867
|
110868
|
110869
|
110870
|
110871
|
110872
|
110873
|
110874
|
110875
|
111446
|
111447
|
111448
|
111449
|
111450
|
111451
|
111452
|
111453
|
111454
|
111455
|
111456
|
111457
|
111458