Bugzilla – Attachment 139924 Details for
Bug 30483
Do not allow NULL in issues.borrowernumber and issues.itemnumber
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL
Bug-30483-Make-issuesborrowernumber-and-itemnumber.patch (text/plain), 3.08 KB, created by
Joonas Kylmälä
on 2022-08-28 14:49:42 UTC
(
hide
)
Description:
Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL
Filename:
MIME Type:
Creator:
Joonas Kylmälä
Created:
2022-08-28 14:49:42 UTC
Size:
3.08 KB
patch
obsolete
>From 8b9d3d81c19a8bf1207af016b6d8fc8696ce9dba Mon Sep 17 00:00:00 2001 >From: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >Date: Thu, 7 Apr 2022 12:51:42 +0000 >Subject: [PATCH] Bug 30483: Make issues.borrowernumber and itemnumber NOT NULL >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Note: This change does NOT apply to old_issues, where constraints >may result in nullifying these columns. > >Test plan: >Run dbrev. >Try checkout, checkin. > >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> > >Signed-off-by: Joonas Kylmälä <joonas.kylmala@iki.fi> >--- > installer/data/mysql/atomicupdate/bug_30483.pl | 12 ++++++++++++ > installer/data/mysql/kohastructure.sql | 4 ++-- > 2 files changed, 14 insertions(+), 2 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_30483.pl > >diff --git a/installer/data/mysql/atomicupdate/bug_30483.pl b/installer/data/mysql/atomicupdate/bug_30483.pl >new file mode 100755 >index 0000000000..53eeae9962 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_30483.pl >@@ -0,0 +1,12 @@ >+use Modern::Perl; >+ >+return { >+ bug_number => 30483, >+ description => "Make issues.borrowernumber and itemnumber NOT NULL", >+ up => sub { >+ my ($args) = @_; >+ my ($dbh, $out) = @$args{qw(dbh out)}; >+ my $sql = "ALTER TABLE issues MODIFY COLUMN borrowernumber int(11) NOT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', MODIFY COLUMN itemnumber int(11) NOT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out'"; >+ $dbh->do($sql); >+ }, >+}; >diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql >index affa80e9c2..4a5166409d 100644 >--- a/installer/data/mysql/kohastructure.sql >+++ b/installer/data/mysql/kohastructure.sql >@@ -3137,9 +3137,9 @@ DROP TABLE IF EXISTS `issues`; > /*!40101 SET character_set_client = utf8 */; > CREATE TABLE `issues` ( > `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for issues table', >- `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', >+ `borrowernumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to', > `issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item', >- `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', >+ `itemnumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out', > `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)', > `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out', > `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues', >-- >2.30.2
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 30483
:
133079
|
133080
|
139195
|
139682
|
139683
| 139924 |
139925