[Bug 30899] New: Upgrade sometimes fails at "Upgrade to 21.11.05.004"
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Bug ID: 30899 Summary: Upgrade sometimes fails at "Upgrade to 21.11.05.004" Change sponsored?: --- Product: Koha Version: 21.11 Hardware: All OS: All Status: NEW Severity: critical Priority: P5 - low Component: Installation and upgrade (command-line installer) Assignee: koha-bugs@lists.koha-community.org Reporter: magnus@libriotech.no QA Contact: testopia@bugs.koha-community.org I just ran a Debian package upgrade on a test server, from 21.11.04-2 to 21.11.06-1. Some of the upgrades ran just fine, while others stopped at 21.11.05.004: ... Upgrade to 21.11.05.003 [10:59:51]: Bug 30565 - Update table stockrotationrotas Upgrade to 21.11.05.004 [10:59:51]: Bug 30449 - Check borrower_attribute_types FK constraint ERROR - {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CONSTRAINT category_code_fk' at line 1 at /usr/share/koha/lib/C4/Installer.pm line 739 Upgrading database schema for <next site> ... The server has 79 instances on the server, and 19 of those were affected by this problem. So far I can not really see a pattern based on the age of the sites, or similar things. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #1 from Magnus Enger <magnus@libriotech.no> --- Looks like the problem is on line 11 of /usr/share/koha/intranet/cgi-bin/installer/data/mysql/db_revs/211105004.pl: 10 if( foreign_key_exists('borrower_attribute_types', 'category_code_fk') ) { 11 $dbh->do( q|ALTER TABLE borrower_attribute_types DROP CONSTRAINT category_code_fk| ); 12 if( index_exists('borrower_attribute_types', 'category_code_fk') ) { 13 $dbh->do( q|ALTER TABLE borrower_attribute_types DROP INDEX category_code_fk| ); 14 } 15 } -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #2 from Magnus Enger <magnus@libriotech.no> --- This is from a database where the update succeeded: MariaDB [koha_ok]> show create table borrower_attribute_types\G *************************** 1. row *************************** Table: borrower_attribute_types Create Table: CREATE TABLE `borrower_attribute_types` ( `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `repeatable` tinyint(1) NOT NULL DEFAULT '0', `unique_id` tinyint(1) NOT NULL DEFAULT '0', `opac_display` tinyint(1) NOT NULL DEFAULT '0', `opac_editable` tinyint(1) NOT NULL DEFAULT '0', `staff_searchable` tinyint(1) NOT NULL DEFAULT '0', `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `display_checkout` tinyint(1) NOT NULL DEFAULT '0', `category_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT '0', `mandatory` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code` (`category_code`), CONSTRAINT `borrower_attribute_types_ibfk_1` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.00 sec) And this is from a database where it failed: MariaDB [koha_fail]> show create table borrower_attribute_types\G *************************** 1. row *************************** Table: borrower_attribute_types Create Table: CREATE TABLE `borrower_attribute_types` ( `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `repeatable` tinyint(1) NOT NULL DEFAULT '0', `unique_id` tinyint(1) NOT NULL DEFAULT '0', `opac_display` tinyint(1) NOT NULL DEFAULT '0', `opac_editable` tinyint(1) NOT NULL DEFAULT '0', `staff_searchable` tinyint(1) NOT NULL DEFAULT '0', `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `display_checkout` tinyint(1) NOT NULL DEFAULT '0', `category_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT '0', `mandatory` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code_fk` (`category_code`), CONSTRAINT `category_code_fk` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.00 sec) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #3 from Magnus Enger <magnus@libriotech.no> --- This is from the site that succeeded, before the upgrade (taken from last night's backup): CREATE TABLE `borrower_attribute_types` ( `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `repeatable` tinyint(1) NOT NULL DEFAULT '0', `unique_id` tinyint(1) NOT NULL DEFAULT '0', `opac_display` tinyint(1) NOT NULL DEFAULT '0', `opac_editable` tinyint(1) NOT NULL DEFAULT '0', `staff_searchable` tinyint(1) NOT NULL DEFAULT '0', `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `display_checkout` tinyint(1) NOT NULL DEFAULT '0', `category_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT '0', `mandatory` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code_fk` (`category_code`), CONSTRAINT `category_code_fk` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; And this is the same for the site that failed: CREATE TABLE `borrower_attribute_types` ( `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `repeatable` tinyint(1) NOT NULL DEFAULT '0', `unique_id` tinyint(1) NOT NULL DEFAULT '0', `opac_display` tinyint(1) NOT NULL DEFAULT '0', `opac_editable` tinyint(1) NOT NULL DEFAULT '0', `staff_searchable` tinyint(1) NOT NULL DEFAULT '0', `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `display_checkout` tinyint(1) NOT NULL DEFAULT '0', `category_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT '0', `mandatory` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci; -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #4 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- It's because you have a FK with the same name "category_code_fk" -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Jonathan Druart <jonathan.druart+koha@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |30449 CC| |jonathan.druart+koha@gmail. | |com Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30449 [Bug 30449] Missing FK constraint on borrower_attribute_types -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |m.de.rooy@rijksmuseum.nl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |fridolin.somers@biblibre.co | |m --- Comment #5 from Fridolin Somers <fridolin.somers@biblibre.com> --- I see upgrade 3.07.00.034 adds : ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode) -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #6 from Fridolin Somers <fridolin.somers@biblibre.com> --- This is from Bug 7154 that did not add the constraint in kohastructure.sql -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #7 from Magnus Enger <magnus@libriotech.no> --- The relevant code in the database update is: if( foreign_key_exists('borrower_attribute_types', 'category_code_fk') ) { $dbh->do( q|ALTER TABLE borrower_attribute_types DROP CONSTRAINT category_code_fk| ); ... } The database that succeeds had this before the upgrade: PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code_fk` (`category_code`), CONSTRAINT `category_code_fk` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) And the one that fails had: PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`) C4::Installer::foreign_key_exists looks like this 648 sub foreign_key_exists { 649 my ( $table_name, $constraint_name ) = @_; 650 my $dbh = C4::Context->dbh; 651 my (undef, $infos) = $dbh->selectrow_array(qq|SHOW CREATE TABLE $table_name|); 652 return $infos =~ m|CONSTRAINT `$constraint_name` FOREIGN KEY|; 653 } Looks to me like the "if" above should prevent the "ALTER TABLE borrower_attribute_types DROP CONSTRAINT category_code_fk" from being run against the database at all? -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #8 from Fridolin Somers <fridolin.somers@biblibre.com> --- (In reply to Magnus Enger from comment #1)
Looks like the problem is on line 11 of /usr/share/koha/intranet/cgi-bin/installer/data/mysql/db_revs/211105004.pl:
10 if( foreign_key_exists('borrower_attribute_types', 'category_code_fk') ) { 11 $dbh->do( q|ALTER TABLE borrower_attribute_types DROP CONSTRAINT category_code_fk| ); 12 if( index_exists('borrower_attribute_types', 'category_code_fk') ) { 13 $dbh->do( q|ALTER TABLE borrower_attribute_types DROP INDEX category_code_fk| ); 14 } 15 }
Ahhh, the syntax is not : DROP CONSTRAINT category_code_fk it is : DROP FOREIGN KEY category_code_fk -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #9 from Fridolin Somers <fridolin.somers@biblibre.com> --- Both exists : https://mariadb.com/kb/en/alter-table/#drop-constraint https://mariadb.com/kb/en/alter-table/#drop-foreign-key But in all other existing DBRevs it is "DROP FOREIGN KEY". For example : https://git.koha-community.org/Koha-community/Koha/src/branch/master/install... -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #10 from Magnus Enger <magnus@libriotech.no> --- If I change this line in the database update: $dbh->do( q|ALTER TABLE borrower_attribute_types DROP CONSTRAINT category_code_fk| ); to this: $dbh->do( q|ALTER TABLE borrower_attribute_types DROP FOREIGN KEY category_code_fk| ); the update completes: $ sudo koha-upgrade-schema koha Upgrading database schema for koha Upgrade to 21.11.05.004 [12:19:49]: Bug 30449 - Check borrower_attribute_types FK constraint Upgrade to 21.11.05.005 [12:19:49]: Bug 30572 - Adjust search_marc_to_field.sort Upgrade to 21.11.06.000 [12:19:49]: Koha 21.11.06 release And after this the table looks like this: MariaDB [koha_esme]> SHOW CREATE TABLE borrower_attribute_types\G *************************** 1. row *************************** Table: borrower_attribute_types Create Table: CREATE TABLE `borrower_attribute_types` ( `code` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL, `description` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL, `repeatable` tinyint(1) NOT NULL DEFAULT '0', `unique_id` tinyint(1) NOT NULL DEFAULT '0', `opac_display` tinyint(1) NOT NULL DEFAULT '0', `opac_editable` tinyint(1) NOT NULL DEFAULT '0', `staff_searchable` tinyint(1) NOT NULL DEFAULT '0', `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `display_checkout` tinyint(1) NOT NULL DEFAULT '0', `category_code` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL, `class` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '', `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT '0', `mandatory` tinyint(1) NOT NULL DEFAULT '0', PRIMARY KEY (`code`), KEY `auth_val_cat_idx` (`authorised_value_category`), KEY `category_code` (`category_code`), CONSTRAINT `borrower_attribute_types_ibfk_1` FOREIGN KEY (`category_code`) REFERENCES `categories` (`categorycode`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci 1 row in set (0.00 sec) As far as I can see, this is the same as for the database where the upgrade succeeded in the first place. -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |m.de.rooy@rijksmuseum.nl |ity.org | Status|NEW |ASSIGNED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Bug 30899 depends on bug 30449, which changed state. Bug 30449 Summary: Missing FK constraint on borrower_attribute_types https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30449 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to stable |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #11 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135779&action=edit Bug 30899: [MASTER 22.12] Correct dbrev 211200041 Replace DROP CONSTRAINT by DROP FOREIGN KEY. Note: It seems that we do not need a new dbrev for master. A developer could follow test plan below to correct if really needed. Test plan: NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1. [1] cp installer/data/mysql/db_revs/211200041.pl installer/data/mysql/atomicupdate/ [2] run updatedatabase; check show create table [3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table [4] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table [5] rm installer/data/atomicupdate/211200041.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|21.11 |master Component|Installation and upgrade |Database |(command-line installer) | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #12 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Still coming patches for 22.05 and 21.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Small patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #13 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135780&action=edit Bug 30899: [22.05.x] Follow-up for dbrev 211200041 from bug 30449 Replace DROP CONSTRAINT by DROP FOREIGN KEY in old dbrev, and submit a new dbrev to fix cases where dbrev went wrong. Test plan: NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1. [1] run updatedatabase; check show create table [2] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table [3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #14 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Created attachment 135783 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135783&action=edit Bug 30899: [21.11.x] Follow-up for dbrev 211200041 from bug 30449 Replace DROP CONSTRAINT by DROP FOREIGN KEY in old dbrev, and submit a new dbrev to fix cases where dbrev went wrong. Test plan: NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1. [1] run updatedatabase; check show create table [2] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table [3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This database revision release notes| |fixes the one from bug | |30449 for table | |borrower_attribute_types. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |arthur.suzuki@biblibre.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Marcel de Rooy <m.de.rooy@rijksmuseum.nl> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |tomascohen@gmail.com --- Comment #15 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- Jonathan: Do you want to check this one, or straight to Tomas? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #16 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- Magnus maybe, can you test this is working for you? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #17 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Jonathan Druart from comment #16)
Magnus maybe, can you test this is working for you?
Comment10 confirms that more or less. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30907 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also|https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=30907 | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #135779|0 |1 is obsolete| | --- Comment #18 from Fridolin Somers <fridolin.somers@biblibre.com> --- Created attachment 135790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=135790&action=edit Bug 30899: [MASTER 22.12] Correct dbrev 211200041 Replace DROP CONSTRAINT by DROP FOREIGN KEY. Note: It seems that we do not need a new dbrev for master. A developer could follow test plan below to correct if really needed. Test plan: NOTE: When you check show create table, verify that you see an index for category_code and a foreign key called borrower_attribute_types_ibfk_1. [1] cp installer/data/mysql/db_revs/211200041.pl installer/data/mysql/atomicupdate/ [2] run updatedatabase; check show create table [3] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; alter table borrower_attribute_types drop index category_code; RUN updatedatabase again; check show create table [4] alter table borrower_attribute_types drop foreign key borrower_attribute_types_ibfk_1; ALTER TABLE borrower_attribute_types ADD CONSTRAINT category_code_fk FOREIGN KEY (category_code) REFERENCES categories(categorycode); RUN updatedatabase again; check show create table [5] rm installer/data/atomicupdate/211200041.pl Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |fridolin.somers@biblibre.co |y.org |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #19 from Fridolin Somers <fridolin.somers@biblibre.com> --- @RM : remove [MASTER 22.12] when pushing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Tomás Cohen Arazi <tomascohen@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)| |22.11.00 released in| | Status|Passed QA |Pushed to master -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #20 from Tomás Cohen Arazi <tomascohen@gmail.com> --- Pushed to master for 22.11. Nice work everyone, thanks! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Bug 30899 depends on bug 30449, which changed state. Bug 30449 Summary: Missing FK constraint on borrower_attribute_types https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30449 What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |Needs documenting Resolution|FIXED |--- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Bug 30899 depends on bug 30449, which changed state. Bug 30449 Summary: Missing FK constraint on borrower_attribute_types https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30449 What |Removed |Added ---------------------------------------------------------------------------- Status|Needs documenting |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Lucas Gass <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00 |22.11.00, 22.05.x released in| | Status|Pushed to master |Pushed to stable --- Comment #21 from Lucas Gass <lucas@bywatersolutions.com> --- Backported to 22.05.x for 22.05.01 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 victor <vbovictor@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |vbovictor@gmail.com --- Comment #22 from victor <vbovictor@gmail.com> --- Will the next updates fix this bug? Or do you need to do the correction manually? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #23 from victor <vbovictor@gmail.com> --- Complementing the information. I saw this error when updating to version 22.05.02.000 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #24 from victor <vbovictor@gmail.com> --- In ubuntu 20.05 and Koha 22.05.02.000 $ koha-upgrade-schema faes Upgrading database schema for faes DEV atomic update /usr/share/koha/intranet/cgi-bin/installer/data/mysql/atomicupdate/bug_30899.pl [22:09:37]: Bug 30899 - Check borrower_attribute_types FK constraint (30449 follow-up) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #25 from Jonathan Druart <jonathan.druart+koha@gmail.com> --- (In reply to victor from comment #24)
In ubuntu 20.05 and Koha 22.05.02.000 $ koha-upgrade-schema faes Upgrading database schema for faes DEV atomic update /usr/share/koha/intranet/cgi-bin/installer/data/mysql/atomicupdate/bug_30899. pl [22:09:37]: Bug 30899 - Check borrower_attribute_types FK constraint (30449 follow-up)
Nothing wrong here. Your DB schema is up-to-date. Lucas forgot to move a file from the atomicupdate directory to db_revs. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Mason James <mtj@kohaaloha.com> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=31108 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Fridolin Somers <fridolin.somers@biblibre.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Version(s)|22.11.00, 22.05.x |22.11.00,22.05.01 released in| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #26 from Fridolin Somers <fridolin.somers@biblibre.com> --- Fixed in 22.05.03 by : e40fa1af65 Remove atomicupdate file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |syamsivanmail@gmail.com --- Comment #27 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- *** Bug 31301 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Federico Paiz <federicoantoniopaiz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - low |P2 CC| |federicoantoniopaiz@gmail.c | |om Version|Main |24.11 OS|All |Linux --- Comment #28 from Federico Paiz <federicoantoniopaiz@gmail.com> --- Hello, we are having a problem adding a loan, it shows us this error in the logs DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.creation_date' in 'field list' at /usr/share/koha/lib/Koha/Objects.pm line 321: /usr/share/koha/intranet/cgi-bin/circ/circulation.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #29 from Marcel de Rooy <m.de.rooy@rijksmuseum.nl> --- (In reply to Federico Paiz from comment #28)
Hello, we are having a problem adding a loan, it shows us this error in the logs
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Unknown column 'me.creation_date' in 'field list' at /usr/share/koha/lib/Koha/Objects.pm line 321: /usr/share/koha/intranet/cgi-bin/circ/circulation.pl
This does not seem to be related to this bug. Could you open a new bug or link to one matching your issue more closely? Thanks. Note: Please provide further details on that bug (not here) on Koha version, SQL version and other relevant info. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 Federico Paiz <federicoantoniopaiz@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|Database |Circulation CC| |gmcharlt@gmail.com, | |kyle.m.hall@gmail.com --- Comment #30 from Federico Paiz <federicoantoniopaiz@gmail.com> --- Hola, estamos teniendo un problema para agregar un préstamo, nos muestra este error en los registros We move 20.11 to version 24.11 DBIx::Clasa::Tarjetivo::DBI::-dbh-ejecute(): DBI Excepción: DBD::mysql::st execute fall: Columna desconocida 'me.creation-date' en 'campo list' en /usr/share/koha/lib/Koha/Objectspm line 321: /usr/share/koha/intranet/cgi-bin/circulation.pl -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899 --- Comment #31 from Katrin Fischer <katrin.fischer@bsz-bw.de> --- (In reply to Federico Paiz from comment #30)
Hola, estamos teniendo un problema para agregar un préstamo, nos muestra este error en los registros We move 20.11 to version 24.11
DBIx::Clasa::Tarjetivo::DBI::-dbh-ejecute(): DBI Excepción: DBD::mysql::st execute fall: Columna desconocida 'me.creation-date' en 'campo list' en /usr/share/koha/lib/Koha/Objectspm line 321: /usr/share/koha/intranet/cgi-bin/circulation.pl
Hi, please try to ask on the Mattermost channel (chat.koha-community.org) or on the Spanish speaking mailing list instead. This sounds like a configuration/update issue and this bug has been long closed. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org