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

(-)a/installer/data/mysql/atomicupdate/bug_30483.pl (+12 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number => 30483,
5
    description => "Make issues.borrowernumber and itemnumber NOT NULL",
6
    up => sub {
7
        my ($args) = @_;
8
        my ($dbh, $out) = @$args{qw(dbh out)};
9
        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'";
10
        $dbh->do($sql);
11
    },
12
};
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 3127-3135 DROP TABLE IF EXISTS `issues`; Link Here
3127
/*!40101 SET character_set_client = utf8 */;
3127
/*!40101 SET character_set_client = utf8 */;
3128
CREATE TABLE `issues` (
3128
CREATE TABLE `issues` (
3129
  `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for issues table',
3129
  `issue_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key for issues table',
3130
  `borrowernumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to',
3130
  `borrowernumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the borrowers table for the patron this item was checked out to',
3131
  `issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item',
3131
  `issuer_id` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the borrowers table for the user who checked out this item',
3132
  `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out',
3132
  `itemnumber` int(11) NOT NULL COMMENT 'foreign key, linking this to the items table for the item that was checked out',
3133
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3133
  `date_due` datetime DEFAULT NULL COMMENT 'datetime the item is due (yyyy-mm-dd hh:mm::ss)',
3134
  `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',
3134
  `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',
3135
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3135
  `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
3136
- 

Return to bug 30483