[Koha-bugs] [Bug 24658] Deleting items with fines does not update itemnumber in accountlines to NULL causing ISE
bugzilla-daemon at bugs.koha-community.org
bugzilla-daemon at bugs.koha-community.org
Tue Oct 13 17:53:06 CEST 2020
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=24658
--- Comment #11 from Cindy Murdock Ames <cmurdock at ccfls.org> ---
(In reply to Jonathan Druart from comment #9)
> There is a FK on accountlines.itemnumber, and apparently it is there for a
> long time now.
>
> Can you confirm that this constraint does not exist in your database?
>
> "show create table accountlines;" will tell you if there is a CONSTRAINT on
> items.itemnumber
It looks to me like mine doesn't have that constraint. Here's my output:
accountlines | CREATE TABLE `accountlines` (
`accountlines_id` int(11) NOT NULL AUTO_INCREMENT,
`issue_id` int(11) DEFAULT NULL,
`borrowernumber` int(11) DEFAULT NULL,
`itemnumber` int(11) DEFAULT NULL,
`date` date DEFAULT NULL,
`amount` decimal(28,6) DEFAULT NULL,
`description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`credit_type_code` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`debit_type_code` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`status` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`payment_type` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`amountoutstanding` decimal(28,6) DEFAULT NULL,
`timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE
current_timestamp(),
`note` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`manager_id` int(11) DEFAULT NULL,
`register_id` int(11) DEFAULT NULL,
`interface` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL,
`branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
PRIMARY KEY (`accountlines_id`),
KEY `acctsborridx` (`borrowernumber`),
KEY `timeidx` (`timestamp`),
KEY `itemnumber` (`itemnumber`),
KEY `accountlines_ibfk_branches` (`branchcode`),
KEY `accountlines_ibfk_borrowers_2` (`manager_id`),
KEY `accountlines_ibfk_registers` (`register_id`),
KEY `accountlines_ibfk_debit_type` (`debit_type_code`),
KEY `accountlines_ibfk_credit_type` (`credit_type_code`),
CONSTRAINT `accountlines_ibfk_borrowers_2` FOREIGN KEY (`manager_id`)
REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `accountlines_ibfk_branches` FOREIGN KEY (`branchcode`) REFERENCES
`branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE,
CONSTRAINT `accountlines_ibfk_credit_type` FOREIGN KEY (`credit_type_code`)
REFERENCES `account_credit_types` (`code`) ON UPDATE CASCADE,
CONSTRAINT `accountlines_ibfk_debit_type` FOREIGN KEY (`debit_type_code`)
REFERENCES `account_debit_types` (`code`) ON UPDATE CASCADE,
CONSTRAINT `accountlines_ibfk_registers` FOREIGN KEY (`register_id`)
REFERENCES `cash_registers` (`id`) ON DELETE SET NULL ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=469046 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_unicode_ci |
--
You are receiving this mail because:
You are watching all bug changes.
More information about the Koha-bugs
mailing list