[Koha-bugs] [Bug 30899] Upgrade sometimes fails at "Upgrade to 21.11.05.004"

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Fri Jun 3 12:24:18 CEST 2022


https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=30899

--- Comment #10 from Magnus Enger <magnus at 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.


More information about the Koha-bugs mailing list