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

(-)a/installer/data/mysql/kohastructure.sql (+22 lines)
Lines 3313-3318 ALTER TABLE `patron_list_patrons` Link Here
3313
  ADD CONSTRAINT patron_list_patrons_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE;
3313
  ADD CONSTRAINT patron_list_patrons_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE;
3314
3314
3315
3315
3316
--
3317
-- Table structure for table 'aqcreditnotes'
3318
--
3319
3320
DROP TABLE IF EXISTS aqcreditnotes;
3321
CREATE TABLE aqcreditnotes (
3322
  `creditnote_id` int(11) NOT NULL AUTO_INCREMENT,    -- ID of the creditnote, primary key
3323
  `booksellerid` int(11) NOT NULL,    -- foreign key to aqbooksellers
3324
  `invoiceid` int(11) NOT NULL,    -- foreign key to aqinvoices
3325
  `vendorrefid` varchar(20) NOT NULL, -- Vendorreferenceid
3326
  `budget_id` int(11) NOT NULL, -- foreign key to aqbudgets
3327
  `amountcredit` decimal(28,6) default NULL,  -- amountcredit cost
3328
  `creditdate` date default NULL,   -- date of amountcredit
3329
  `notes` mediumtext,  -- notes of amountcredit
3330
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
3331
  PRIMARY KEY (creditnote_id),
3332
  CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
3333
  CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
3334
  CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE CASCADE ON UPDATE CASCADE
3335
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3336
3337
3316
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3338
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3317
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3339
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3318
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3340
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +20 lines)
Lines 7595-7600 if ( CheckVersion($DBversion) ) { Link Here
7595
    SetVersion($DBversion);
7595
    SetVersion($DBversion);
7596
}
7596
}
7597
7597
7598
$DBversion = "3.13.00.XXX";
7599
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7600
    $dbh->do("CREATE TABLE aqcreditnotes (
7601
                    `creditnote_id` int(11) NOT NULL AUTO_INCREMENT,
7602
                    `booksellerid` int(11) NOT NULL,
7603
                    `invoiceid` int(11) NOT NULL,
7604
                    `vendorrefid` varchar(80) NOT NULL,
7605
                    `budget_id` int(11) NOT NULL,
7606
                    `amountcredit` decimal(28,6) default NULL,
7607
                    `creditdate` date default NULL,
7608
                    `notes` mediumtext,
7609
                    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
7610
                    PRIMARY KEY (creditnote_id),
7611
                    CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
7612
                    CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
7613
                    CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
7614
              ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
7615
    print "Upgrade to $DBversion done (Added new table aqcreditnotes)\n";
7616
    SetVersion($DBversion);
7617
}
7598
7618
7599
=head1 FUNCTIONS
7619
=head1 FUNCTIONS
7600
7620
7601
- 

Return to bug 10412