From 34e0861fd5642e8a6522bd435ce4562e226cbde8 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 20 Mar 2025 09:54:46 +0100 Subject: [PATCH] Bug 39325: Adjust DB We need to adjust kohastructure.sql, sysprefs.sql and the DB itself. --- .../data/mysql/atomicupdate/bug_39325.pl | 109 ++++++++++++++++++ installer/data/mysql/db_revs/220600059.pl | 8 +- installer/data/mysql/kohastructure.sql | 28 ++--- installer/data/mysql/mandatory/sysprefs.sql | 2 +- 4 files changed, 128 insertions(+), 19 deletions(-) create mode 100755 installer/data/mysql/atomicupdate/bug_39325.pl diff --git a/installer/data/mysql/atomicupdate/bug_39325.pl b/installer/data/mysql/atomicupdate/bug_39325.pl new file mode 100755 index 00000000000..1a07a89f242 --- /dev/null +++ b/installer/data/mysql/atomicupdate/bug_39325.pl @@ -0,0 +1,109 @@ +use Modern::Perl; +use Koha::Installer::Output qw(say_warning say_success say_info); + +return { + bug_number => "39325", + description => "Fix some spelling mistakes", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + # avaiable ==> available + $dbh->do( + q{ + UPDATE systempreferences + SET explanation="If enabled, item fields in the MARC record will be made available to XSLT sheets. Otherwise they will be removed." + WHERE variable="PassItemMarcToXSLT" + } + ); + + # foriegn ==> foreign + $dbh->do( + q{ + ALTER TABLE deletedbiblio + MODIFY `frameworkcode` varchar(4) NOT NULL DEFAULT '' COMMENT 'foreign key from the biblio_framework table to identify which framework was used in cataloging this record' + } + ); + + # addres ==> address + # attemps ==> attempts + # profesionals ==> professionals + $dbh->do( + q{ + ALTER TABLE borrowers + MODIFY `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email address for your patron/borrower''s primary address', + MODIFY `login_attempts` int(4) NOT NULL DEFAULT 0 COMMENT 'number of failed login attempts', + MODIFY `contactname` longtext DEFAULT NULL COMMENT 'used for children and professionals to include surname or last name of guarantor or organization name' + } + ); + + # addres ==> address + # attemps ==> attempts + # profesionals ==> professionals + $dbh->do( + q{ + ALTER TABLE deletedborrowers + MODIFY `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email address for your patron/borrower''s primary address', + MODIFY `login_attempts` int(4) NOT NULL DEFAULT 0 COMMENT 'number of failed login attempts', + MODIFY `contactname` longtext DEFAULT NULL COMMENT 'used for children and professionals to include surname or last name of guarantor or organization name' + } + ); + + # agains ==> against + $dbh->do( + q{ + ALTER TABLE club_holds + MODIFY `item_id` int(11) DEFAULT NULL COMMENT 'If item-level, the id for the item the hold has been placed against' + } + ); + + # intented ==> intended + $dbh->do( + q{ + ALTER TABLE items + MODIFY `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intended to be managed by the automatic_item_modification_by_age cronjob.' + } + ); + + # intented ==> intended + $dbh->do( + q{ + ALTER TABLE deleteditems + MODIFY `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intended to be managed by the automatic_item_modification_by_age cronjob.' + } + ); + + # definining ==> defining + $dbh->do( + q{ + ALTER TABLE housebound_profile + MODIFY `frequency` mediumtext NOT NULL COMMENT 'The Authorised_Value defining the pattern for delivery.' + } + ); + + # goup ==> group + $dbh->do( + q{ + ALTER TABLE library_groups + MODIFY `title` varchar(100) DEFAULT NULL COMMENT 'Short description of the group' + } + ); + + # shoud ==> should + $dbh->do( + q{ + ALTER TABLE stockrotationstages + MODIFY `duration` int(11) NOT NULL DEFAULT 4 COMMENT 'The number of days items should occupy this stage' + } + ); + + # thist ==> this + $dbh->do( + q{ + ALTER TABLE virtualshelfshares + MODIFY `invitekey` varchar(10) DEFAULT NULL COMMENT 'temporary string used in accepting the invitation to access this list; not-empty means that the invitation has not been accepted yet' + } + ); + + }, +}; diff --git a/installer/data/mysql/db_revs/220600059.pl b/installer/data/mysql/db_revs/220600059.pl index 8acbdbf8115..897e7f78e53 100755 --- a/installer/data/mysql/db_revs/220600059.pl +++ b/installer/data/mysql/db_revs/220600059.pl @@ -8,11 +8,11 @@ return { my ( $dbh, $out ) = @$args{qw(dbh out)}; # Add PASSWORD_CHANGE notice + my $message = "Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\n" + . "We want to notify you that your password has been changed. If you did not change it yourself (or requested that change), please contact library staff.\r\n\r\nYour library."; $dbh->do( - q{ - INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PASSWORD_CHANGE', 'Notification of password change', 'Library account password change notification', - "Dear [% borrower.firstname %] [% borrower.surname %],\r\n\r\new want to notify you that your password has been changed. If you did not change it yourself (or requested that change), please contact library staff.\r\n\r\nYour library.", 'email'); - } + q{INSERT IGNORE INTO letter (module, code, name, title, content, message_transport_type) VALUES ('members', 'PASSWORD_CHANGE', 'Notification of password change', 'Library account password change notification',?, 'email');}, + $message ); say $out "Added new letter 'PASSWORD_CHANGE' (email)"; diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 9b7dc7fc6ec..1ced0711c81 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -1546,7 +1546,7 @@ CREATE TABLE `borrowers` ( `phone` mediumtext DEFAULT NULL COMMENT 'the primary phone number for your patron/borrower''s primary address', `mobile` tinytext DEFAULT NULL COMMENT 'the other phone number for your patron/borrower''s primary address', `fax` longtext DEFAULT NULL COMMENT 'the fax number for your patron/borrower''s primary address', - `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email addres for your patron/borrower''s primary address', + `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email address for your patron/borrower''s primary address', `phonepro` mediumtext DEFAULT NULL COMMENT 'the secondary phone number for your patron/borrower''s primary address', `B_streetnumber` tinytext DEFAULT NULL COMMENT 'the house number for your patron/borrower''s alternate address', `B_streettype` tinytext DEFAULT NULL COMMENT 'the street type (Rd., Blvd, etc) for your patron/borrower''s alternate address', @@ -1569,7 +1569,7 @@ CREATE TABLE `borrowers` ( `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', `debarred` date DEFAULT NULL COMMENT 'until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)', `debarredcomment` varchar(255) DEFAULT NULL COMMENT 'comment on the stop of the patron', - `contactname` longtext DEFAULT NULL COMMENT 'used for children and profesionals to include surname or last name of guarantor or organization name', + `contactname` longtext DEFAULT NULL COMMENT 'used for children and professionals to include surname or last name of guarantor or organization name', `contactfirstname` mediumtext DEFAULT NULL COMMENT 'used for children to include first name of guarantor', `contacttitle` mediumtext DEFAULT NULL COMMENT 'used for children to include title (Mr., Mrs., etc) of guarantor', `borrowernotes` longtext DEFAULT NULL COMMENT 'a note on the patron/borrower''s account that is only visible in the staff interface', @@ -1602,7 +1602,7 @@ CREATE TABLE `borrowers` ( `updated_on` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'time of last change could be useful for synchronization with external systems (among others)', `lastseen` datetime DEFAULT NULL COMMENT 'last time a patron has been seen (connected at the OPAC or staff interface)', `lang` varchar(25) NOT NULL DEFAULT 'default' COMMENT 'lang to use to send notices to this patron', - `login_attempts` int(4) NOT NULL DEFAULT 0 COMMENT 'number of failed login attemps', + `login_attempts` int(4) NOT NULL DEFAULT 0 COMMENT 'number of failed login attempts', `overdrive_auth_token` mediumtext 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', @@ -2037,7 +2037,7 @@ CREATE TABLE `club_holds` ( `id` int(11) NOT NULL AUTO_INCREMENT, `club_id` int(11) NOT NULL COMMENT 'id for the club the hold was generated for', `biblio_id` int(11) NOT NULL COMMENT 'id for the bibliographic record the hold has been placed against', - `item_id` int(11) DEFAULT NULL COMMENT 'If item-level, the id for the item the hold has been placed agains', + `item_id` int(11) DEFAULT NULL COMMENT 'If item-level, the id for the item the hold has been placed against', `date_created` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Timestamp for the placed hold', PRIMARY KEY (`id`), KEY `clubs_holds_ibfk_1` (`club_id`), @@ -2582,7 +2582,7 @@ DROP TABLE IF EXISTS `deletedbiblio`; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `deletedbiblio` ( `biblionumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique identifier assigned to each bibliographic record', - `frameworkcode` varchar(4) NOT NULL DEFAULT '' COMMENT 'foriegn key from the biblio_framework table to identify which framework was used in cataloging this record', + `frameworkcode` varchar(4) NOT NULL DEFAULT '' COMMENT 'foreign key from the biblio_framework table to identify which framework was used in cataloging this record', `author` longtext DEFAULT NULL COMMENT 'statement of responsibility from MARC record (100$a in MARC21)', `title` longtext DEFAULT NULL COMMENT 'title (without the subtitle) from the MARC record (245$a in MARC21)', `medium` longtext DEFAULT NULL COMMENT 'medium from the MARC record (245$h in MARC21)', @@ -2707,7 +2707,7 @@ CREATE TABLE `deletedborrowers` ( `phone` mediumtext DEFAULT NULL COMMENT 'the primary phone number for your patron/borrower''s primary address', `mobile` tinytext DEFAULT NULL COMMENT 'the other phone number for your patron/borrower''s primary address', `fax` longtext DEFAULT NULL COMMENT 'the fax number for your patron/borrower''s primary address', - `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email addres for your patron/borrower''s primary address', + `emailpro` mediumtext DEFAULT NULL COMMENT 'the secondary email address for your patron/borrower''s primary address', `phonepro` mediumtext DEFAULT NULL COMMENT 'the secondary phone number for your patron/borrower''s primary address', `B_streetnumber` tinytext DEFAULT NULL COMMENT 'the house number for your patron/borrower''s alternate address', `B_streettype` tinytext DEFAULT NULL COMMENT 'the street type (Rd., Blvd, etc) for your patron/borrower''s alternate address', @@ -2730,7 +2730,7 @@ CREATE TABLE `deletedborrowers` ( `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', `debarred` date DEFAULT NULL COMMENT 'until this date the patron can only check-in (no loans, no holds, etc.), is a fine based on days instead of money (YYYY-MM-DD)', `debarredcomment` varchar(255) DEFAULT NULL COMMENT 'comment on the stop of patron', - `contactname` longtext DEFAULT NULL COMMENT 'used for children and profesionals to include surname or last name of guarantor or organization name', + `contactname` longtext DEFAULT NULL COMMENT 'used for children and professionals to include surname or last name of guarantor or organization name', `contactfirstname` mediumtext DEFAULT NULL COMMENT 'used for children to include first name of guarantor', `contacttitle` mediumtext DEFAULT NULL COMMENT 'used for children to include title (Mr., Mrs., etc) of guarantor', `borrowernotes` longtext DEFAULT NULL COMMENT 'a note on the patron/borrower''s account that is only visible in the staff interface', @@ -2829,7 +2829,7 @@ CREATE TABLE `deleteditems` ( `enumchron` mediumtext DEFAULT NULL COMMENT 'serial enumeration/chronology for the item (MARC21 952$h)', `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)', `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)', - `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.', + `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intended to be managed by the automatic_item_modification_by_age cronjob.', `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority', PRIMARY KEY (`itemnumber`), KEY `delitembarcodeidx` (`barcode`), @@ -3521,7 +3521,7 @@ DROP TABLE IF EXISTS `housebound_profile`; CREATE TABLE `housebound_profile` ( `borrowernumber` int(11) NOT NULL COMMENT 'Number of the borrower associated with this profile.', `day` mediumtext NOT NULL COMMENT 'The preferred day of the week for delivery.', - `frequency` mediumtext NOT NULL COMMENT 'The Authorised_Value definining the pattern for delivery.', + `frequency` mediumtext NOT NULL COMMENT 'The Authorised_Value defining the pattern for delivery.', `fav_itemtypes` mediumtext DEFAULT NULL COMMENT 'Free text describing preferred itemtypes.', `fav_subjects` mediumtext DEFAULT NULL COMMENT 'Free text describing preferred subjects.', `fav_authors` mediumtext DEFAULT NULL COMMENT 'Free text describing preferred authors.', @@ -4150,7 +4150,7 @@ CREATE TABLE `items` ( `enumchron` mediumtext DEFAULT NULL COMMENT 'serial enumeration/chronology for the item (MARC21 952$h)', `copynumber` varchar(32) DEFAULT NULL COMMENT 'copy number (MARC21 952$t)', `stocknumber` varchar(32) DEFAULT NULL COMMENT 'inventory number (MARC21 952$i)', - `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intented to be managed by the automatic_item_modification_by_age cronjob.', + `new_status` varchar(32) DEFAULT NULL COMMENT '''new'' value, you can put whatever free-text information. This field is intended to be managed by the automatic_item_modification_by_age cronjob.', `exclude_from_local_holds_priority` tinyint(1) DEFAULT NULL COMMENT 'Exclude this item from local holds priority', PRIMARY KEY (`itemnumber`), UNIQUE KEY `itembarcodeidx` (`barcode`), @@ -4397,7 +4397,7 @@ CREATE TABLE `library_groups` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique id for each group', `parent_id` int(11) DEFAULT NULL COMMENT 'if this is a child group, the id of the parent group', `branchcode` varchar(10) DEFAULT NULL COMMENT 'The branchcode of a branch belonging to the parent group', - `title` varchar(100) DEFAULT NULL COMMENT 'Short description of the goup', + `title` varchar(100) DEFAULT NULL COMMENT 'Short description of the group', `description` mediumtext DEFAULT NULL COMMENT 'Longer explanation of the group, if necessary', `ft_hide_patron_info` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Turn on the feature ''Hide patron''s info'' for this group', `ft_limit_item_editing` tinyint(1) NOT NULL DEFAULT 0 COMMENT 'Turn on the feature "Limit item editing by group" for this group', @@ -6123,7 +6123,7 @@ CREATE TABLE `stockrotationstages` ( `position` int(11) NOT NULL COMMENT 'The position of this stage within its rota', `rota_id` int(11) NOT NULL COMMENT 'The rota this stage belongs to', `branchcode_id` varchar(10) NOT NULL COMMENT 'Branch this stage relates to', - `duration` int(11) NOT NULL DEFAULT 4 COMMENT 'The number of days items shoud occupy this stage', + `duration` int(11) NOT NULL DEFAULT 4 COMMENT 'The number of days items should occupy this stage', PRIMARY KEY (`stage_id`), KEY `stockrotationstages_rifk` (`rota_id`), KEY `stockrotationstages_bifk` (`branchcode_id`), @@ -6703,7 +6703,7 @@ CREATE TABLE `virtualshelfshares` ( `id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'unique key', `shelfnumber` int(11) NOT NULL COMMENT 'foreign key for virtualshelves', `borrowernumber` int(11) DEFAULT NULL COMMENT 'borrower that accepted access to this list', - `invitekey` varchar(10) DEFAULT NULL COMMENT 'temporary string used in accepting the invitation to access thist list; not-empty means that the invitation has not been accepted yet', + `invitekey` varchar(10) DEFAULT NULL COMMENT 'temporary string used in accepting the invitation to access this list; not-empty means that the invitation has not been accepted yet', `sharedate` datetime DEFAULT NULL COMMENT 'date of invitation or acceptance of invitation', PRIMARY KEY (`id`), KEY `virtualshelfshares_ibfk_1` (`shelfnumber`), @@ -6796,4 +6796,4 @@ CREATE TABLE `zebraqueue` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2024-11-25 12:13:27 \ No newline at end of file +-- Dump completed on 2024-11-25 12:13:27 diff --git a/installer/data/mysql/mandatory/sysprefs.sql b/installer/data/mysql/mandatory/sysprefs.sql index f9e2c643a1f..ea681bded69 100644 --- a/installer/data/mysql/mandatory/sysprefs.sql +++ b/installer/data/mysql/mandatory/sysprefs.sql @@ -603,7 +603,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OverdueNoticeFrom', 'cron', 'cron|item-issuebranch|item-homebranch', 'Organize and send overdue notices by item home library or checkout library', 'Choice'), ('OverduesBlockCirc','noblock','noblock|confirmation|block','When checking out an item should overdues block checkout, generate a confirmation dialogue, or allow checkout','Choice'), ('OverduesBlockRenewing','allow','allow|blockitem|block','If any of patron checked out documents is late, should renewal be allowed, blocked only on overdue items or blocked on whatever checked out document','Choice'), -('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made avaiable to XSLT sheets. Otherwise they will be removed.','YesNo'), +('PassItemMarcToXSLT','0',NULL,'If enabled, item fields in the MARC record will be made available to XSLT sheets. Otherwise they will be removed.','YesNo'), ('PatronAnonymizeDelay','',NULL,'Delay for anonymizing patrons', 'Integer'), ('PatronAutoComplete','1','Try|Don\'t try','to guess the patron being entered while typing a patron search for circulation or patron search. Only returns the first 10 results at a time.','YesNo'), ('PatronDuplicateMatchingAddFields','surname|firstname|dateofbirth', NULL,'A list of fields separated by "|" to deduplicate patrons when created','Free'), -- 2.34.1