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

(-)a/installer/data/mysql/kohastructure.sql (+22 lines)
Lines 3276-3281 ALTER TABLE `patron_list_patrons` Link Here
3276
  ADD CONSTRAINT patron_list_patrons_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE;
3276
  ADD CONSTRAINT patron_list_patrons_ibfk_2 FOREIGN KEY (borrowernumber) REFERENCES borrowers (borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE;
3277
3277
3278
3278
3279
--
3280
-- Table structure for table 'aqcreditnotes'
3281
--
3282
3283
DROP TABLE IF EXISTS aqcreditnotes;
3284
CREATE TABLE aqcreditnotes (
3285
  `creditnote_id` int(11) NOT NULL AUTO_INCREMENT,    -- ID of the creditnote, primary key
3286
  `booksellerid` int(11) NOT NULL,    -- foreign key to aqbooksellers
3287
  `invoiceid` int(11) NOT NULL,    -- foreign key to aqinvoices
3288
  `vendorrefid` varchar(20) NOT NULL, -- Vendorreferenceid
3289
  `budget_id` int(11) NOT NULL, -- foreign key to aqbudgets
3290
  `amountcredit` decimal(28,6) default NULL,  -- amountcredit cost
3291
  `creditdate` date default NULL,   -- date of amountcredit
3292
  `notes` mediumtext,  -- notes of amountcredit
3293
  `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP, -- date and time this record was last touched
3294
  PRIMARY KEY (creditnote_id),
3295
  CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
3296
  CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
3297
  CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (budget_id) REFERENCES aqbudgets (budget_id) ON DELETE CASCADE ON UPDATE CASCADE
3298
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
3299
3300
3279
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3301
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
3280
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3302
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
3281
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
3303
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +21 lines)
Lines 7306-7311 if ( CheckVersion($DBversion) ) { Link Here
7306
    SetVersion($DBversion);
7306
    SetVersion($DBversion);
7307
}
7307
}
7308
7308
7309
$DBversion = "3.13.00.XXX";
7310
if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
7311
    $dbh->do("CREATE TABLE aqcreditnotes (
7312
                    `creditnote_id` int(11) NOT NULL AUTO_INCREMENT,
7313
                    `booksellerid` int(11) NOT NULL,
7314
                    `invoiceid` int(11) NOT NULL,
7315
                    `vendorrefid` varchar(80) NOT NULL,
7316
                    `budget_id` int(11) NOT NULL,
7317
                    `amountcredit` decimal(28,6) default NULL,
7318
                    `creditdate` date default NULL,
7319
                    `notes` mediumtext,
7320
                    `timestamp` timestamp NOT NULL default CURRENT_TIMESTAMP on update CURRENT_TIMESTAMP,
7321
                    PRIMARY KEY (creditnote_id),
7322
                    CONSTRAINT aqcreditnotes_fk_aqbooksellerid FOREIGN KEY (booksellerid) REFERENCES aqbooksellers (id) ON DELETE CASCADE ON UPDATE CASCADE,
7323
                    CONSTRAINT aqcreditnotes_fk_invoiceid FOREIGN KEY (invoiceid) REFERENCES aqinvoices (invoiceid) ON DELETE CASCADE ON UPDATE CASCADE,
7324
                    CONSTRAINT aqcreditnotes_fk_budget_id FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE
7325
              ) ENGINE=InnoDB DEFAULT CHARSET=utf8");
7326
    print "Upgrade to $DBversion done (Added new table aqcreditnotes)\n";
7327
    SetVersion($DBversion);
7328
}
7329
7309
=head1 FUNCTIONS
7330
=head1 FUNCTIONS
7310
7331
7311
=head2 TableExists($table)
7332
=head2 TableExists($table)
7312
- 

Return to bug 10412