Bug 30392: (QA follow-up) Correct COMMENT
[koha-ffzg.git] / installer / data / mysql / kohastructure.sql
index 9bc4add..3f524ae 100644 (file)
@@ -1,8 +1,13 @@
--- MySQL dump 10.16  Distrib 10.1.48-MariaDB, for debian-linux-gnu (x86_64)
+-- MariaDB dump 10.19  Distrib 10.5.15-MariaDB, for debian-linux-gnu (x86_64)
 --
 -- Host: db    Database: koha_kohadev
 -- ------------------------------------------------------
--- Server version      10.5.10-MariaDB-1:10.5.10+maria~focal
+-- Server version      10.8.3-MariaDB-1:10.8.3+maria~jammy
+
+-- IMPORTANT NOTE:
+-- The lines with /*! are silently IGNORED when the web installer runs this
+-- file (in C4::Installer, using DBIx::RunSQL).
+-- The lines only work when you run this sql script directly with mysql.
 
 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
 /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
@@ -170,6 +175,7 @@ CREATE TABLE `action_logs` (
   `object` int(11) DEFAULT NULL COMMENT 'the object that the action was taken against (could be a borrowernumber, itemnumber, etc)',
   `info` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'information about the action (usually includes SQL statement)',
   `interface` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the context this action was taken in',
+  `script` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'the name of the cron script that caused this change',
   PRIMARY KEY (`action_id`),
   KEY `timestamp_idx` (`timestamp`),
   KEY `user_idx` (`user`),
@@ -182,6 +188,36 @@ CREATE TABLE `action_logs` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `additional_contents`
+--
+
+DROP TABLE IF EXISTS `additional_contents`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `additional_contents` (
+  `idnew` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for the additional content',
+  `category` varchar(20) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'category for the additional content',
+  `code` varchar(100) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'code to group content per lang',
+  `location` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'location of the additional content',
+  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'branch code users to create branch specific additional content, NULL is every branch.',
+  `title` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'title of the additional content',
+  `content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the body of your additional content',
+  `lang` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac)',
+  `published_on` date DEFAULT NULL COMMENT 'publication date',
+  `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'last modification',
+  `expirationdate` date DEFAULT NULL COMMENT 'date the additional content is set to expire or no longer be visible',
+  `number` int(11) DEFAULT NULL COMMENT 'the order in which this additional content appears in that specific location',
+  `borrowernumber` int(11) DEFAULT NULL COMMENT 'The user who created the additional content',
+  PRIMARY KEY (`idnew`),
+  UNIQUE KEY `additional_contents_uniq` (`category`,`code`,`branchcode`,`lang`),
+  KEY `additional_contents_borrowernumber_fk` (`borrowernumber`),
+  KEY `additional_contents_branchcode_ibfk` (`branchcode`),
+  CONSTRAINT `additional_contents_branchcode_ibfk` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `additional_field_values`
 --
 
@@ -210,7 +246,7 @@ CREATE TABLE `additional_fields` (
   `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key identifier',
   `tablename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'tablename of the new field',
   `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'name of the field',
-  `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'is an authorised value category',
+  `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'is an authorised value category',
   `marcfield` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'contains the marc field to copied into the record',
   `searchable` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'is the field searchable?',
   PRIMARY KEY (`id`),
@@ -749,11 +785,12 @@ CREATE TABLE `article_requests` (
   `pages` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `chapters` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `patron_notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  `status` enum('REQUESTED', 'PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED',
+  `status` enum('REQUESTED','PENDING','PROCESSING','COMPLETED','CANCELED') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'REQUESTED',
   `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  `format` enum('PHOTOCOPY', 'SCAN') NOT NULL DEFAULT 'PHOTOCOPY',
-  `urls` MEDIUMTEXT,
+  `format` enum('PHOTOCOPY','SCAN') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'PHOTOCOPY',
+  `urls` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `cancellation_reason` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'optional authorised value AR_CANCELLATION',
+  `debit_id` int(11) DEFAULT NULL COMMENT 'Debit line with cost for article scan request',
   `created_on` timestamp NULL DEFAULT NULL COMMENT 'Be careful with two timestamps in one table not allowing NULL',
   `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp(),
   `toc_request` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'borrower requested table of contents',
@@ -762,10 +799,12 @@ CREATE TABLE `article_requests` (
   KEY `biblionumber` (`biblionumber`),
   KEY `itemnumber` (`itemnumber`),
   KEY `branchcode` (`branchcode`),
+  KEY `debit_id` (`debit_id`),
   CONSTRAINT `article_requests_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `article_requests_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `article_requests_ibfk_3` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE CASCADE,
-  CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE
+  CONSTRAINT `article_requests_ibfk_4` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE SET NULL ON UPDATE CASCADE,
+  CONSTRAINT `article_requests_ibfk_5` FOREIGN KEY (`debit_id`) REFERENCES `accountlines` (`accountlines_id`) ON DELETE SET NULL ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -824,7 +863,7 @@ CREATE TABLE `auth_subfield_structure` (
   `repeatable` tinyint(4) NOT NULL DEFAULT 0,
   `mandatory` tinyint(4) NOT NULL DEFAULT 0,
   `tab` tinyint(1) DEFAULT NULL,
-  `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `value_builder` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `seealso` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `isurl` tinyint(1) DEFAULT NULL,
@@ -854,7 +893,7 @@ CREATE TABLE `auth_tag_structure` (
   `libopac` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
   `repeatable` tinyint(4) NOT NULL DEFAULT 0,
   `mandatory` tinyint(4) NOT NULL DEFAULT 0,
-  `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   PRIMARY KEY (`authtypecode`,`tagfield`),
   CONSTRAINT `auth_tag_structure_ibfk_1` FOREIGN KEY (`authtypecode`) REFERENCES `auth_types` (`authtypecode`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -944,7 +983,9 @@ CREATE TABLE `background_jobs` (
   `size` int(11) DEFAULT NULL,
   `borrowernumber` int(11) DEFAULT NULL,
   `type` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  `data` text COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `queue` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Name of the queue the job is sent to',
+  `data` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `context` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'JSON-serialized context information for the job',
   `enqueued_on` datetime DEFAULT NULL,
   `started_on` datetime DEFAULT NULL,
   `ended_on` datetime DEFAULT NULL,
@@ -1091,7 +1132,9 @@ CREATE TABLE `borrower_attribute_types` (
   `keep_for_pseudonymization` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if this field is copied to anonymized_borrower_attributes (1 for yes, 0 for no)',
   `mandatory` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'defines if the attribute is mandatory or not',
   PRIMARY KEY (`code`),
-  KEY `auth_val_cat_idx` (`authorised_value_category`)
+  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;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -1231,6 +1274,7 @@ CREATE TABLE `borrower_modifications` (
   `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `surname` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `firstname` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `middle_name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s middle name',
   `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
@@ -1294,7 +1338,7 @@ CREATE TABLE `borrower_modifications` (
   `privacy` int(11) DEFAULT NULL,
   `extended_attributes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `gdpr_proc_consent` datetime DEFAULT NULL COMMENT 'data processing consent',
-  `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes',
+  `primary_contact_method` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'useful for reporting purposes',
   PRIMARY KEY (`verification_token`(191),`borrowernumber`),
   KEY `verification_token` (`verification_token`(191)),
   KEY `borrowernumber` (`borrowernumber`)
@@ -1349,6 +1393,7 @@ CREATE TABLE `borrowers` (
   `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'unique key, library assigned ID number for patrons/borrowers',
   `surname` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s last name (surname)',
   `firstname` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s first name',
+  `middle_name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s middle name',
   `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s title, for example: Mr. or Mrs.',
   `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any other names associated with the patron/borrower',
   `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'initials for your patron/borrower',
@@ -1381,6 +1426,7 @@ CREATE TABLE `borrowers` (
   `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the categories table, includes the code of the patron category',
   `dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)',
   `dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)',
+  `password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)',
   `date_renewed` date DEFAULT NULL COMMENT 'date the patron/borrower''s card was last renewed',
   `gonenoaddress` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address',
   `lost` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card',
@@ -1393,6 +1439,8 @@ CREATE TABLE `borrowers` (
   `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor',
   `sex` varchar(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s gender',
   `password` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s Bcrypt encrypted password',
+  `secret` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA',
+  `auth_method` enum('password','two-factor') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'password' COMMENT 'Authentication method',
   `flags` int(11) DEFAULT NULL COMMENT 'will include a number associated with the staff member''s permissions',
   `userid` varchar(75) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s opac and/or staff interface log in',
   `opacnote` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'a note on the patron/borrower''s account that is visible in the OPAC and staff interface',
@@ -1421,7 +1469,7 @@ CREATE TABLE `borrowers` (
   `overdrive_auth_token` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'persist OverDrive auth token',
   `anonymized` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'flag for data anonymization',
   `autorenew_checkouts` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'flag for allowing auto-renewal',
-  `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes',
+  `primary_contact_method` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'useful for reporting purposes',
   PRIMARY KEY (`borrowernumber`),
   UNIQUE KEY `cardnumber` (`cardnumber`),
   UNIQUE KEY `userid` (`userid`),
@@ -1485,6 +1533,7 @@ CREATE TABLE `branches` (
   `geolocation` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'geolocation of your library',
   `marcorgcode` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'MARC Organization Code, see http://www.loc.gov/marc/organizations/orgshome.html, when empty defaults to syspref MARCOrgCode',
   `pickup_location` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'the ability to act as a pickup location',
+  `public` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'whether this library should show in the opac',
   PRIMARY KEY (`branchcode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -1521,8 +1570,8 @@ CREATE TABLE `branchtransfers` (
   `datecancelled` datetime DEFAULT NULL COMMENT 'the date the transfer was cancelled',
   `tobranch` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'the branch the transfer was going to',
   `comments` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any comments related to the transfer',
-  `reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer',
-  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost', 'WrongTransfer') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
+  `reason` ENUM('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','TransferCancellation','Recall','RecallCancellation') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer',
+  `cancellation_reason` enum('Manual','StockrotationAdvance','StockrotationRepatriation','ReturnToHome','ReturnToHolding','RotatingCollection','Reserve','LostReserve','CancelReserve','ItemLost','WrongTransfer','CancelRecall') COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'what triggered the transfer cancellation',
   PRIMARY KEY (`branchtransfer_id`),
   KEY `frombranch` (`frombranch`),
   KEY `tobranch` (`tobranch`),
@@ -1605,6 +1654,7 @@ CREATE TABLE `categories` (
   `description` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'description of the patron category',
   `enrolmentperiod` smallint(6) DEFAULT NULL COMMENT 'number of months the patron is enrolled for (will be NULL if enrolmentperioddate is set)',
   `enrolmentperioddate` date DEFAULT NULL COMMENT 'date the patron is enrolled until (will be NULL if enrolmentperiod is set)',
+  `password_expiry_days` smallint(6) DEFAULT NULL COMMENT 'number of days after which the patron must reset their password',
   `upperagelimit` smallint(6) DEFAULT NULL COMMENT 'age limit for the patron',
   `dateofbirthrequired` tinyint(1) DEFAULT NULL COMMENT 'the minimum age required for the patron category',
   `finetype` varchar(30) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'unused in Koha',
@@ -1618,6 +1668,7 @@ CREATE TABLE `categories` (
   `BlockExpiredPatronOpacActions` tinyint(1) NOT NULL DEFAULT -1 COMMENT 'wheither or not a patron of this category can renew books or place holds once their card has expired. 0 means they can, 1 means they cannot, -1 means use syspref BlockExpiredPatronOpacActions',
   `default_privacy` enum('default','never','forever') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'default' COMMENT 'Default privacy setting for this patron category',
   `checkprevcheckout` varchar(7) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'inherit' COMMENT 'produce a warning for this patron category if this item has previously been checked out to this patron if ''yes'', not if ''no'', defer to syspref setting if ''inherit''.',
+  `can_be_guarantee` tinyint(1) NOT NULL default 0 COMMENT 'if patrons of this category can be guarantees',
   `reset_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can do the password reset flow,',
   `change_password` tinyint(1) DEFAULT NULL COMMENT 'if patrons of this category can change their passwords in the OAPC',
   `min_password_length` smallint(6) DEFAULT NULL COMMENT 'set minimum password length for patrons in this category',
@@ -1646,6 +1697,26 @@ CREATE TABLE `categories_branches` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `checkout_renewals`
+--
+
+DROP TABLE IF EXISTS `checkout_renewals`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `checkout_renewals` (
+  `renewal_id` int(11) NOT NULL AUTO_INCREMENT,
+  `checkout_id` int(11) DEFAULT NULL COMMENT 'the id of the checkout this renewal pertains to',
+  `renewer_id` int(11) DEFAULT NULL COMMENT 'the id of the user who processed the renewal',
+  `seen` tinyint(1) DEFAULT 0 COMMENT 'boolean denoting whether the item was present or not',
+  `interface` varchar(16) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the interface this renewal took place on',
+  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'the date and time the renewal took place',
+  PRIMARY KEY (`renewal_id`),
+  KEY `renewer_id` (`renewer_id`),
+  CONSTRAINT `renewals_renewer_id` FOREIGN KEY (`renewer_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `circulation_rules`
 --
 
@@ -1810,6 +1881,37 @@ CREATE TABLE `club_fields` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `item_groups`
+--
+
+DROP TABLE IF EXISTS `item_groups`;
+CREATE TABLE `item_groups` (
+  `item_group_id` INT(11) NOT NULL auto_increment COMMENT "id for the items group",
+  `biblio_id` INT(11) NOT NULL DEFAULT 0 COMMENT "id for the bibliographic record the group belongs to",
+  `display_order` INT(4) NOT NULL DEFAULT 0 COMMENT "The 'sort order' for item_groups",
+  `description` MEDIUMTEXT default NULL COMMENT "A group description",
+  `created_on` TIMESTAMP NULL COMMENT "Time and date the group was created",
+  `updated_on` TIMESTAMP NOT NULL ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP COMMENT "Time and date of the latest change on the group",
+  PRIMARY KEY  (`item_group_id`),
+  CONSTRAINT `item_groups_ibfk_1` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Table structure for table `item_group_items`
+--
+
+DROP TABLE IF EXISTS `item_group_items`;
+CREATE TABLE `item_group_items` (
+  `item_group_items_id` int(11) NOT NULL auto_increment COMMENT "id for the group/item link",
+  `item_group_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key making this table a 1 to 1 join from items to item groups",
+  `item_id` INT(11) NOT NULL DEFAULT 0 COMMENT "foreign key linking this table to the items table",
+  PRIMARY KEY  (`item_group_items_id`),
+  UNIQUE KEY (`item_id`),
+  CONSTRAINT `item_group_items_iifk_1` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `item_group_items_gifk_1` FOREIGN KEY (`item_group_id`) REFERENCES `item_groups` (`item_group_id`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
 -- Table structure for table `club_holds`
 --
 
@@ -1868,7 +1970,7 @@ CREATE TABLE `club_template_enrollment_fields` (
   `club_template_id` int(11) NOT NULL,
   `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
   `description` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `club_template_id` (`club_template_id`),
   CONSTRAINT `club_template_enrollment_fields_ibfk_1` FOREIGN KEY (`club_template_id`) REFERENCES `club_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -1887,7 +1989,7 @@ CREATE TABLE `club_template_fields` (
   `club_template_id` int(11) NOT NULL,
   `name` text COLLATE utf8mb4_unicode_ci NOT NULL,
   `description` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  `authorised_value_category` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `authorised_value_category` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   PRIMARY KEY (`id`),
   KEY `club_template_id` (`club_template_id`),
   CONSTRAINT `club_template_fields_ibfk_1` FOREIGN KEY (`club_template_id`) REFERENCES `club_templates` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -2048,9 +2150,9 @@ CREATE TABLE `course_items` (
   KEY `fk_course_items_biblionumber` (`biblionumber`),
   CONSTRAINT `course_items_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `course_items_ibfk_2` FOREIGN KEY (`holdingbranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `fk_course_items_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `fk_course_items_homebranch` FOREIGN KEY (`homebranch`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
-  CONSTRAINT `fk_course_items_homebranch_storage` FOREIGN KEY (`homebranch_storage`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE,
-  CONSTRAINT `fk_course_items_biblionumber` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE
+  CONSTRAINT `fk_course_items_homebranch_storage` FOREIGN KEY (`homebranch_storage`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -2224,6 +2326,77 @@ CREATE TABLE `creator_templates` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `curbside_pickup_policy`
+--
+
+DROP TABLE IF EXISTS `curbside_pickup_policy`;
+CREATE TABLE `curbside_pickup_policy` (
+  `id` int(11) NOT NULL auto_increment,
+  `branchcode` varchar(10) NOT NULL,
+  `enabled` TINYINT(1) NOT NULL DEFAULT 0,
+  `enable_waiting_holds_only` TINYINT(1) NOT NULL DEFAULT 0,
+  `pickup_interval` INT(2) NOT NULL DEFAULT 0,
+  `patrons_per_interval` INT(2) NOT NULL DEFAULT 0,
+  `patron_scheduled_pickup` TINYINT(1) NOT NULL DEFAULT 0,
+  PRIMARY KEY (`id`),
+  UNIQUE KEY (`branchcode`),
+  FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Table structure for table `curbside_pickup_opening_slots`
+--
+
+DROP TABLE IF EXISTS `curbside_pickup_opening_slots`;
+CREATE TABLE `curbside_pickup_opening_slots` (
+    `id` INT(11) NOT NULL AUTO_INCREMENT,
+    `curbside_pickup_policy_id` INT(11) NOT NULL,
+    `day` TINYINT(1) NOT NULL,
+    `start_hour` INT(2) NOT NULL,
+    `start_minute` INT(2) NOT NULL,
+    `end_hour` INT(2) NOT NULL,
+    `end_minute` INT(2) NOT NULL,
+    PRIMARY KEY (`id`),
+    FOREIGN KEY (curbside_pickup_policy_id) REFERENCES curbside_pickup_policy(id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Table structure for table `curbside_pickups`
+--
+
+DROP TABLE IF EXISTS `curbside_pickups`;
+CREATE TABLE `curbside_pickups` (
+  `id` int(11) NOT NULL auto_increment,
+  `borrowernumber` int(11) NOT NULL,
+  `branchcode` varchar(10) NOT NULL,
+  `scheduled_pickup_datetime` datetime NOT NULL,
+  `staged_datetime` datetime NULL DEFAULT NULL,
+  `staged_by` int(11) NULL DEFAULT NULL,
+  `arrival_datetime` datetime NULL DEFAULT NULL,
+  `delivered_datetime` datetime NULL DEFAULT NULL,
+  `delivered_by` int(11) NULL DEFAULT NULL,
+  `notes` text NULL DEFAULT NULL,
+  PRIMARY KEY (`id`),
+  FOREIGN KEY (branchcode) REFERENCES branches(branchcode) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (borrowernumber) REFERENCES borrowers(borrowernumber) ON DELETE CASCADE ON UPDATE CASCADE,
+  FOREIGN KEY (staged_by) REFERENCES borrowers(borrowernumber) ON DELETE SET NULL ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
+-- Table structure for table `curbside_pickup_issues`
+--
+
+DROP TABLE IF EXISTS `curbside_pickup_issues`;
+CREATE TABLE `curbside_pickup_issues` (
+  `id` int(11) NOT NULL auto_increment,
+  `curbside_pickup_id` int(11) NOT NULL,
+  `issue_id` int(11) NOT NULL,
+  `reserve_id` int(11) NOT NULL,
+  PRIMARY KEY (`id`),
+  FOREIGN KEY (curbside_pickup_id) REFERENCES curbside_pickups(id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+
+--
 -- Table structure for table `currency`
 --
 
@@ -2356,6 +2529,7 @@ CREATE TABLE `deletedborrowers` (
   `cardnumber` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'unique key, library assigned ID number for patrons/borrowers',
   `surname` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s last name (surname)',
   `firstname` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s first name',
+  `middle_name` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s middle name',
   `title` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s title, for example: Mr. or Mrs.',
   `othernames` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'any other names associated with the patron/borrower',
   `initials` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'initials for your patron/borrower',
@@ -2388,6 +2562,7 @@ CREATE TABLE `deletedborrowers` (
   `categorycode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'foreign key from the categories table, includes the code of the patron category',
   `dateenrolled` date DEFAULT NULL COMMENT 'date the patron was added to Koha (YYYY-MM-DD)',
   `dateexpiry` date DEFAULT NULL COMMENT 'date the patron/borrower''s card is set to expire (YYYY-MM-DD)',
+  `password_expiration_date` date DEFAULT NULL COMMENT 'date the patron/borrower''s password is set to expire (YYYY-MM-DD)',
   `date_renewed` date DEFAULT NULL COMMENT 'date the patron/borrower''s card was last renewed',
   `gonenoaddress` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having an unconfirmed address',
   `lost` tinyint(1) DEFAULT NULL COMMENT 'set to 1 for yes and 0 for no, flag to note that library marked this patron/borrower as having lost their card',
@@ -2400,6 +2575,8 @@ CREATE TABLE `deletedborrowers` (
   `relationship` varchar(100) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'used for children to include the relationship to their guarantor',
   `sex` varchar(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s gender',
   `password` varchar(60) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s encrypted password',
+  `secret` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Secret for 2FA',
+  `auth_method` enum('password','two-factor') COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT 'password' COMMENT 'Authentication method',
   `flags` int(11) DEFAULT NULL COMMENT 'will include a number associated with the staff member''s permissions',
   `userid` varchar(75) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'patron/borrower''s opac and/or staff interface log in',
   `opacnote` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'a note on the patron/borrower''s account that is visible in the OPAC and staff interface',
@@ -2428,7 +2605,7 @@ CREATE TABLE `deletedborrowers` (
   `overdrive_auth_token` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'persist OverDrive auth token',
   `anonymized` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'flag for data anonymization',
   `autorenew_checkouts` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'flag for allowing auto-renewal',
-  `primary_contact_method` varchar(45) DEFAULT NULL COMMENT 'useful for reporting purposes',
+  `primary_contact_method` varchar(45) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'useful for reporting purposes',
   KEY `borrowernumber` (`borrowernumber`),
   KEY `cardnumber` (`cardnumber`),
   KEY `sms_provider_id` (`sms_provider_id`)
@@ -2473,6 +2650,7 @@ CREATE TABLE `deleteditems` (
   `itemnotes_nonpublic` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'non-public notes on this item (MARC21 952$x)',
   `holdingbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)',
   `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time this item was last altered',
+  `deleted_on` DATETIME DEFAULT NULL COMMENT 'date/time of deletion',
   `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
   `permanent_location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
   `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
@@ -2742,6 +2920,7 @@ CREATE TABLE `illrequests` (
   `illrequest_id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT 'ILL request number',
   `borrowernumber` int(11) DEFAULT NULL COMMENT 'Patron associated with request',
   `biblio_id` int(11) DEFAULT NULL COMMENT 'Potential bib linked to request',
+  `due_date` datetime DEFAULT NULL COMMENT 'Custom date due specified by backend, leave NULL for default date_due calculation',
   `branchcode` varchar(50) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'The branch associated with the request',
   `status` varchar(50) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Current Koha status of request',
   `status_alias` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Foreign key to relevant authorised_values.authorised_value',
@@ -2901,6 +3080,8 @@ CREATE TABLE `import_record_matches` (
   `import_record_id` int(11) NOT NULL COMMENT 'the id given to the imported bib record (import_records.import_record_id)',
   `candidate_match_id` int(11) NOT NULL COMMENT 'the biblio the imported record matches (biblio.biblionumber)',
   `score` int(11) NOT NULL DEFAULT 0 COMMENT 'the match score',
+  `chosen` tinyint(1) DEFAULT NULL COMMENT 'whether this match has been allowed or denied',
+  PRIMARY KEY (`import_record_id`,`candidate_match_id`),
   KEY `record_score` (`import_record_id`,`score`),
   CONSTRAINT `import_record_matches_ibfk_1` FOREIGN KEY (`import_record_id`) REFERENCES `import_records` (`import_record_id`) ON DELETE CASCADE ON UPDATE CASCADE
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -2952,7 +3133,7 @@ CREATE TABLE `issues` (
   `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
   `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned, will be NULL until moved to old_issues',
   `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
-  `renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
+  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
   `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
   `auto_renew` tinyint(1) DEFAULT 0 COMMENT 'automatic renewal',
   `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'automatic renewal error',
@@ -3031,6 +3212,7 @@ CREATE TABLE `items` (
   `itemnotes_nonpublic` longtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'non-public notes on this item (MARC21 952$x)',
   `holdingbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table for the library that is currently in possession item (MARC21 952$b)',
   `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time this item was last altered',
+  `deleted_on` DATETIME DEFAULT NULL COMMENT 'date/time of deletion',
   `location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'authorized value for the shelving location for this item (MARC21 952$c)',
   `permanent_location` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'linked to the CART and PROC temporary locations feature, stores the permanent shelving location',
   `onloan` date DEFAULT NULL COMMENT 'defines if item is checked out (NULL for not checked out, and due date for checked out)',
@@ -3066,6 +3248,23 @@ CREATE TABLE `items` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table item_bundles
+--
+
+DROP TABLE IF EXISTS `item_bundles`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `item_bundles` (
+  `item` int(11) NOT NULL,
+  `host` int(11) NOT NULL,
+  PRIMARY KEY (`host`, `item`),
+  UNIQUE KEY `item_bundles_uniq_1` (`item`),
+  CONSTRAINT `item_bundles_ibfk_1` FOREIGN KEY (`item`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `item_bundles_ibfk_2` FOREIGN KEY (`host`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `items_last_borrower`
 --
 
@@ -3183,8 +3382,8 @@ CREATE TABLE `language_descriptions` (
   `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `id` int(11) NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (`id`),
-  KEY `lang` (`lang`),
-  KEY `subtag_type_lang` (`subtag`,`type`,`lang`)
+  UNIQUE KEY `uniq_desc` (`subtag`,`type`,`lang`),
+  KEY `lang` (`lang`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -3200,6 +3399,7 @@ CREATE TABLE `language_rfc4646_to_iso639` (
   `iso639_2_code` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `id` int(11) NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (`id`),
+  UNIQUE KEY `uniq_code` (`rfc4646_subtag`,`iso639_2_code`),
   KEY `rfc4646_subtag` (`rfc4646_subtag`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -3226,9 +3426,9 @@ DROP TABLE IF EXISTS `language_script_mapping`;
 /*!40101 SET @saved_cs_client     = @@character_set_client */;
 /*!40101 SET character_set_client = utf8 */;
 CREATE TABLE `language_script_mapping` (
-  `language_subtag` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `language_subtag` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL,
   `script_subtag` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
-  KEY `language_subtag` (`language_subtag`)
+  PRIMARY KEY (`language_subtag`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -3242,10 +3442,11 @@ DROP TABLE IF EXISTS `language_subtag_registry`;
 CREATE TABLE `language_subtag_registry` (
   `subtag` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `type` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'language-script-region-variant-extension-privateuse',
-  `description` varchar(25) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'only one of the possible descriptions for ease of reference, see language_descriptions for the complete list',
+  `description` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'only one of the possible descriptions for ease of reference, see language_descriptions for the complete list',
   `added` date DEFAULT NULL,
   `id` int(11) NOT NULL AUTO_INCREMENT,
   PRIMARY KEY (`id`),
+  UNIQUE KEY `uniq_lang` (`subtag`,`type`),
   KEY `subtag` (`subtag`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
@@ -3343,8 +3544,8 @@ CREATE TABLE `linktracker` (
   KEY `borridx` (`borrowernumber`),
   KEY `dateidx` (`timeclicked`),
   CONSTRAINT `linktracker_biblio_ibfk` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE SET NULL,
-  CONSTRAINT `linktracker_item_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL,
-  CONSTRAINT `linktracker_borrower_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL
+  CONSTRAINT `linktracker_borrower_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL,
+  CONSTRAINT `linktracker_item_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE SET NULL ON UPDATE SET NULL
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -3386,36 +3587,6 @@ CREATE TABLE `marc_matchers` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
--- Table structure for table `marc_overlay_rules_modules`
---
-
-DROP TABLE IF EXISTS `marc_overlay_rules_modules`;
-CREATE TABLE `marc_overlay_rules_modules` (
-  `name` varchar(127) NOT NULL,
-  `description` varchar(255),
-  `specificity` int(11) NOT NULL UNIQUE,
-  PRIMARY KEY(`name`)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
---
--- Table structure for table `marc_overlay_rules`
---
-
-DROP TABLE IF EXISTS `marc_overlay_rules`;
-CREATE TABLE IF NOT EXISTS `marc_overlay_rules` (
-  `id`     int(11) NOT NULL auto_increment,
-  `tag`    varchar(255) NOT NULL, -- can be regexp, so need > 3 chars
-  `module` varchar(127) NOT NULL,
-  `filter` varchar(255) NOT NULL,
-  `add`    TINYINT(1) NOT NULL DEFAULT 0,
-  `append` TINYINT(1) NOT NULL DEFAULT 0,
-  `remove` TINYINT(1) NOT NULL DEFAULT 0,
-  `delete` TINYINT(1) NOT NULL DEFAULT 0,
-  PRIMARY KEY(`id`),
-  CONSTRAINT `marc_overlay_rules_ibfk1` FOREIGN KEY (`module`) REFERENCES `marc_overlay_rules_modules` (`name`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-
---
 -- Table structure for table `marc_modification_template_actions`
 --
 
@@ -3464,6 +3635,26 @@ CREATE TABLE `marc_modification_templates` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `marc_overlay_rules`
+--
+
+DROP TABLE IF EXISTS `marc_overlay_rules`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `marc_overlay_rules` (
+  `id` int(11) NOT NULL AUTO_INCREMENT,
+  `tag` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+  `module` varchar(127) COLLATE utf8mb4_unicode_ci NOT NULL,
+  `filter` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
+  `add` tinyint(1) NOT NULL DEFAULT 0,
+  `append` tinyint(1) NOT NULL DEFAULT 0,
+  `remove` tinyint(1) NOT NULL DEFAULT 0,
+  `delete` tinyint(1) NOT NULL DEFAULT 0,
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `marc_subfield_structure`
 --
 
@@ -3514,7 +3705,7 @@ CREATE TABLE `marc_tag_structure` (
   `repeatable` tinyint(4) NOT NULL DEFAULT 0,
   `mandatory` tinyint(4) NOT NULL DEFAULT 0,
   `important` tinyint(4) NOT NULL DEFAULT 0,
-  `authorised_value` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `authorised_value` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `ind1_defaultvalue` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
   `ind2_defaultvalue` varchar(1) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
   `frameworkcode` varchar(4) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '',
@@ -3859,7 +4050,7 @@ CREATE TABLE `old_issues` (
   `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key, linking to the branches table for the location the item was checked out',
   `returndate` datetime DEFAULT NULL COMMENT 'date the item was returned',
   `lastreneweddate` datetime DEFAULT NULL COMMENT 'date the item was last renewed',
-  `renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
+  `renewals_count` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of times the item was renewed',
   `unseen_renewals` tinyint(4) NOT NULL DEFAULT 0 COMMENT 'lists the number of consecutive times the item was renewed without being seen',
   `auto_renew` tinyint(1) DEFAULT 0 COMMENT 'automatic renewal',
   `auto_renew_error` varchar(32) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'automatic renewal error',
@@ -3906,6 +4097,7 @@ CREATE TABLE `old_reserves` (
   `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
   `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
   `expirationdate` date DEFAULT NULL COMMENT 'the date the hold expires (usually the date entered by the patron to say they don''t need the hold after a certain date)',
+  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
   `lowestPriority` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'has this hold been pinned to the lowest priority in the holds queue (1 for yes, 0 for no)',
   `suspend` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'in this hold suspended (1 for yes, 0 for no)',
   `suspend_until` datetime DEFAULT NULL COMMENT 'the date this hold is suspended until (NULL for infinitely)',
@@ -3926,36 +4118,6 @@ CREATE TABLE `old_reserves` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
--- Table structure for table `additional_contents`
---
-
-DROP TABLE IF EXISTS `additional_contents`;
-/*!40101 SET @saved_cs_client     = @@character_set_client */;
-/*!40101 SET character_set_client = utf8 */;
-CREATE TABLE `additional_contents` (
-  `idnew` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'unique identifier for the additional content',
-  `category` varchar(20) NOT NULL COMMENT 'category for the additional content',
-  `code` varchar(20) NOT NULL COMMENT 'code to group content per lang',
-  `location` varchar(255) NOT NULL COMMENT 'location of the additional content',
-  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'branch code users to create branch specific additional content, NULL is every branch.',
-  `title` varchar(250) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'title of the additional content',
-  `content` mediumtext COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the body of your additional content',
-  `lang` varchar(25) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'location for the additional content(koha is the staff interface, slip is the circulation receipt and language codes are for the opac)',
-  `published_on` date DEFAULT NULL COMMENT 'publication date',
-  `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'last modification',
-  `expirationdate` date DEFAULT NULL COMMENT 'date the additional content is set to expire or no longer be visible',
-  `number` int(11) DEFAULT NULL COMMENT 'the order in which this additional content appears in that specific location',
-  `borrowernumber` int(11) DEFAULT NULL COMMENT 'The user who created the additional content',
-  PRIMARY KEY (`idnew`),
-  UNIQUE KEY `additional_contents_uniq` (`category`,`code`,`branchcode`,`lang`),
-  KEY `additional_contents_borrowernumber_fk` (`borrowernumber`),
-  KEY `additional_contents_branchcode_ibfk` (`branchcode`),
-  CONSTRAINT `borrowernumber_fk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
-  CONSTRAINT `additional_contents_branchcode_ibfk` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
-) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
-/*!40101 SET character_set_client = @saved_cs_client */;
-
---
 -- Table structure for table `overduerules`
 --
 
@@ -4241,10 +4403,7 @@ CREATE TABLE `pseudonymized_transactions` (
   PRIMARY KEY (`id`),
   KEY `pseudonymized_transactions_ibfk_1` (`categorycode`),
   KEY `pseudonymized_transactions_borrowers_ibfk_2` (`branchcode`),
-  KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`),
-  CONSTRAINT `pseudonymized_transactions_borrowers_ibfk_2` FOREIGN KEY (`branchcode`) REFERENCES `branches` (`branchcode`),
-  CONSTRAINT `pseudonymized_transactions_borrowers_ibfk_3` FOREIGN KEY (`transaction_branchcode`) REFERENCES `branches` (`branchcode`),
-  CONSTRAINT `pseudonymized_transactions_ibfk_1` FOREIGN KEY (`categorycode`) REFERENCES `categories` (`categorycode`)
+  KEY `pseudonymized_transactions_borrowers_ibfk_3` (`transaction_branchcode`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -4284,6 +4443,41 @@ CREATE TABLE `ratings` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `recalls`
+--
+
+DROP TABLE IF EXISTS `recalls`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `recalls` (
+  `recall_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique identifier for this recall',
+  `patron_id` int(11) NOT NULL DEFAULT 0 COMMENT 'Identifier for patron who requested recall',
+  `created_date` datetime DEFAULT NULL COMMENT 'Date the recall was requested',
+  `biblio_id` int(11) NOT NULL DEFAULT 0 COMMENT 'Identifier for bibliographic record that has been recalled',
+  `pickup_library_id` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Identifier for recall pickup library',
+  `completed_date` datetime DEFAULT NULL COMMENT 'Date the recall is completed (fulfilled, cancelled or expired)',
+  `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'Notes related to the recall',
+  `priority` smallint(6) DEFAULT NULL COMMENT 'Where in the queue the patron sits',
+  `status` enum('requested','overdue','waiting','in_transit','cancelled','expired','fulfilled') COLLATE utf8mb4_unicode_ci DEFAULT 'requested' COMMENT 'Status of recall',
+  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Date and time the recall was last updated',
+  `item_id` int(11) DEFAULT NULL COMMENT 'Identifier for item record that was recalled, if an item-level recall',
+  `waiting_date` datetime DEFAULT NULL COMMENT 'Date an item was marked as waiting for the patron at the library',
+  `expiration_date` datetime DEFAULT NULL COMMENT 'Date recall is no longer required, or date recall will expire after waiting on shelf for pickup',
+  `completed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Flag if recall is old and no longer active, i.e. expired, cancelled or completed',
+  `item_level` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Flag if recall is for a specific item',
+  PRIMARY KEY (`recall_id`),
+  KEY `recalls_ibfk_1` (`patron_id`),
+  KEY `recalls_ibfk_2` (`biblio_id`),
+  KEY `recalls_ibfk_3` (`item_id`),
+  KEY `recalls_ibfk_4` (`pickup_library_id`),
+  CONSTRAINT `recalls_ibfk_1` FOREIGN KEY (`patron_id`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `recalls_ibfk_2` FOREIGN KEY (`biblio_id`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `recalls_ibfk_3` FOREIGN KEY (`item_id`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
+  CONSTRAINT `recalls_ibfk_4` FOREIGN KEY (`pickup_library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Information related to recalls in Koha';
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `repeatable_holidays`
 --
 
@@ -4336,7 +4530,7 @@ CREATE TABLE `reserves` (
   `borrowernumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the borrowers table defining which patron this hold is for',
   `reservedate` date DEFAULT NULL COMMENT 'the date the hold was placed',
   `biblionumber` int(11) NOT NULL DEFAULT 0 COMMENT 'foreign key from the biblio table defining which bib record this hold is on',
-  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
+  `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'foreign key from the branches table defining which branch the patron wishes to pick this hold up at',
   `desk_id` int(11) DEFAULT NULL COMMENT 'foreign key from the desks table defining which desk the patron should pick this hold up at',
   `notificationdate` date DEFAULT NULL COMMENT 'currently unused',
   `reminderdate` date DEFAULT NULL COMMENT 'currently unused',
@@ -4348,7 +4542,8 @@ CREATE TABLE `reserves` (
   `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this hold was last updated',
   `itemnumber` int(11) DEFAULT NULL COMMENT 'foreign key from the items table defining the specific item the patron has placed on hold or the item this hold was filled with',
   `waitingdate` date DEFAULT NULL COMMENT 'the date the item was marked as waiting for the patron at the library',
-  `expirationdate` date DEFAULT NULL COMMENT 'the date the hold expires (usually the date entered by the patron to say they don''t need the hold after a certain date)',
+  `expirationdate` date DEFAULT NULL COMMENT 'the date the hold expires (calculated value)',
+  `patron_expiration_date` date DEFAULT NULL COMMENT 'the date the hold expires - usually the date entered by the patron to say they don''t need the hold after a certain date',
   `lowestPriority` tinyint(1) NOT NULL DEFAULT 0,
   `suspend` tinyint(1) NOT NULL DEFAULT 0,
   `suspend_until` datetime DEFAULT NULL,
@@ -4373,6 +4568,21 @@ CREATE TABLE `reserves` (
 /*!40101 SET character_set_client = @saved_cs_client */;
 
 --
+-- Table structure for table `hold_cancellation_requests`
+--
+
+DROP TABLE IF EXISTS `hold_cancellation_requests`;
+/*!40101 SET @saved_cs_client     = @@character_set_client */;
+/*!40101 SET character_set_client = utf8 */;
+CREATE TABLE `hold_cancellation_requests` (
+  `hold_cancellation_request_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'Unique ID of the cancellation request',
+  `hold_id` int(11) NOT null COMMENT 'ID of the hold',
+  `creation_date` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Time and date the cancellation request was created',
+  PRIMARY KEY (`hold_cancellation_request_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
+/*!40101 SET character_set_client = @saved_cs_client */;
+
+--
 -- Table structure for table `return_claims`
 --
 
@@ -4393,13 +4603,12 @@ CREATE TABLE `return_claims` (
   `resolved_on` timestamp NULL DEFAULT NULL COMMENT 'Time and date the claim was resolved',
   `resolved_by` int(11) DEFAULT NULL COMMENT 'ID of the staff member that resolved the claim',
   PRIMARY KEY (`id`),
-  UNIQUE KEY `issue_id` (`issue_id`),
+  UNIQUE KEY `item_issue` (`itemnumber`, `issue_id`),
   KEY `itemnumber` (`itemnumber`),
   KEY `rc_borrowers_ibfk` (`borrowernumber`),
   KEY `rc_created_by_ibfk` (`created_by`),
   KEY `rc_updated_by_ibfk` (`updated_by`),
   KEY `rc_resolved_by_ibfk` (`resolved_by`),
-  CONSTRAINT `issue_id` FOREIGN KEY (`issue_id`) REFERENCES `issues` (`issue_id`) ON DELETE SET NULL ON UPDATE CASCADE,
   CONSTRAINT `rc_borrowers_ibfk` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `rc_created_by_ibfk` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
   CONSTRAINT `rc_items_ibfk` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
@@ -4486,7 +4695,7 @@ CREATE TABLE `search_field` (
   `id` int(11) NOT NULL AUTO_INCREMENT,
   `name` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the name of the field as it will be stored in the search engine',
   `label` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'the human readable name of the field, for display',
-  `type` enum('','string','date','number','boolean','sum','isbn','stdno') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine',
+  `type` enum('','string','date','number','boolean','sum','isbn','stdno','year','callnumber') COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'what type of data this holds, relevant when storing it in the search engine',
   `weight` decimal(5,2) DEFAULT NULL,
   `facet_order` tinyint(4) DEFAULT NULL COMMENT 'the order place of the field in facet list if faceted',
   `staff_client` tinyint(1) NOT NULL DEFAULT 1,
@@ -4550,7 +4759,7 @@ CREATE TABLE `search_marc_to_field` (
   `search_field_id` int(11) NOT NULL,
   `facet` tinyint(1) DEFAULT 0 COMMENT 'true if a facet field should be generated for this',
   `suggestible` tinyint(1) DEFAULT 0 COMMENT 'true if this field can be used to generate suggestions for browse',
-  `sort` tinyint(1) DEFAULT NULL COMMENT 'true/false creates special sort handling, null doesn''t',
+  `sort` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Sort defaults to 1 (Yes) and creates sort fields in the index, 0 (no) will prevent this',
   PRIMARY KEY (`search_marc_map_id`,`search_field_id`),
   KEY `search_field_id` (`search_field_id`),
   CONSTRAINT `search_marc_to_field_ibfk_1` FOREIGN KEY (`search_marc_map_id`) REFERENCES `search_marc_map` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
@@ -4759,7 +4968,8 @@ CREATE TABLE `stockrotationrotas` (
   `description` text COLLATE utf8mb4_unicode_ci NOT NULL COMMENT 'Description for this rota',
   `cyclical` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Should items on this rota keep cycling?',
   `active` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Is this rota currently active?',
-  PRIMARY KEY (`rota_id`)
+  PRIMARY KEY (`rota_id`),
+  UNIQUE KEY `stockrotationrotas_title` (`title`)
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
 /*!40101 SET character_set_client = @saved_cs_client */;
 
@@ -4826,8 +5036,8 @@ CREATE TABLE `subscription` (
   `branchcode` varchar(10) COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '' COMMENT 'default branches (items.homebranch)',
   `lastbranch` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `serialsadditems` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'does receiving this serial create an item record',
-  `staffdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the staff',
-  `opacdisplaycount` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'how many issues to show to the public',
+  `staffdisplaycount` INT(11) NULL DEFAULT NULL COMMENT 'how many issues to show to the staff',
+  `opacdisplaycount` INT(11) NULL DEFAULT NULL COMMENT 'how many issues to show to the public',
   `graceperiod` int(11) NOT NULL DEFAULT 0 COMMENT 'grace period in days',
   `enddate` date DEFAULT NULL COMMENT 'subscription end date',
   `closed` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'yes / no if the subscription is closed',
@@ -4835,6 +5045,7 @@ CREATE TABLE `subscription` (
   `itemtype` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `previousitemtype` varchar(10) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `mana_id` int(11) DEFAULT NULL,
+  `ccode` varchar(80) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'collection code to assign to serial items',
   PRIMARY KEY (`subscriptionid`),
   KEY `subscription_ibfk_1` (`periodicity`),
   KEY `subscription_ibfk_2` (`numberpattern`),
@@ -5032,7 +5243,7 @@ CREATE TABLE `tables_settings` (
   `module` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
   `page` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
   `tablename` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
-  `default_display_length` smallint(6) NOT NULL DEFAULT 20,
+  `default_display_length` smallint(6) DEFAULT NULL,
   `default_sort_order` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   PRIMARY KEY (`module`(191),`page`(191),`tablename`(191))
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
@@ -5135,6 +5346,8 @@ CREATE TABLE `tmp_holdsqueue` (
   `notes` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `item_level_request` tinyint(4) NOT NULL DEFAULT 0,
   KEY `tmp_holdsqueue_ibfk_1` (`itemnumber`),
+  KEY `tmp_holdsqueue_ibfk_2` (`biblionumber`),
+  KEY `tmp_holdsqueue_ibfk_3` (`borrowernumber`),
   CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`) REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `tmp_holdsqueue_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE CASCADE ON UPDATE CASCADE,
   CONSTRAINT `tmp_holdsqueue_ibfk_3` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE
@@ -5192,7 +5405,8 @@ DROP TABLE IF EXISTS `user_permissions`;
 CREATE TABLE `user_permissions` (
   `borrowernumber` int(11) NOT NULL DEFAULT 0,
   `module_bit` int(11) NOT NULL DEFAULT 0,
-  `code` varchar(64) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `code` varchar(64) COLLATE utf8mb4_unicode_ci NOT NULL,
+  PRIMARY KEY (`borrowernumber`,`module_bit`,`code`),
   KEY `user_permissions_ibfk_1` (`borrowernumber`),
   KEY `user_permissions_ibfk_2` (`module_bit`,`code`),
   CONSTRAINT `user_permissions_ibfk_1` FOREIGN KEY (`borrowernumber`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE CASCADE ON UPDATE CASCADE,
@@ -5234,6 +5448,7 @@ CREATE TABLE `vendor_edi_accounts` (
   `download_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `upload_directory` mediumtext COLLATE utf8mb4_unicode_ci DEFAULT NULL,
   `san` varchar(20) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
+  `standard` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT 'EUR',
   `id_code_qualifier` varchar(3) COLLATE utf8mb4_unicode_ci DEFAULT '14',
   `transport` varchar(6) COLLATE utf8mb4_unicode_ci DEFAULT 'FTP',
   `quotes_enabled` tinyint(1) NOT NULL DEFAULT 0,
@@ -5305,12 +5520,13 @@ CREATE TABLE `virtualshelves` (
   `shelfnumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier assigned by Koha',
   `shelfname` varchar(255) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'name of the list',
   `owner` int(11) DEFAULT NULL COMMENT 'foreign key linking to the borrowers table (using borrowernumber) for the creator of this list (changed from varchar(80) to int)',
-  `category` varchar(1) COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT 'type of list (private [1], public [2])',
+  `public` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'If the list is public',
   `sortfield` varchar(16) COLLATE utf8mb4_unicode_ci DEFAULT 'title' COMMENT 'the field this list is sorted on',
   `lastmodified` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'date and time the list was last modified',
   `created_on` datetime NOT NULL COMMENT 'creation time',
   `allow_change_from_owner` tinyint(1) DEFAULT 1 COMMENT 'can owner change contents?',
   `allow_change_from_others` tinyint(1) DEFAULT 0 COMMENT 'can others change contents?',
+  `allow_change_from_staff` tinyint(1) DEFAULT 0 COMMENT 'can staff change contents?',
   PRIMARY KEY (`shelfnumber`),
   KEY `virtualshelves_ibfk_1` (`owner`),
   CONSTRAINT `virtualshelves_ibfk_1` FOREIGN KEY (`owner`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE SET NULL
@@ -5375,4 +5591,4 @@ CREATE TABLE `zebraqueue` (
 /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
 /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
 
--- Dump completed on 2021-05-27 10:16:37
+-- Dump completed on 2022-05-26  2:46:01