From ebe16e3329fc744d891bdf68879818c3881bddba Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Fri, 29 Apr 2022 08:13:17 -0300 Subject: [PATCH] Bug 30291: (QA follow-up) Keep recall_id column name Signed-off-by: Tomas Cohen Arazi Signed-off-by: Martin Renvoize --- .../mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl | 3 +-- installer/data/mysql/kohastructure.sql | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/installer/data/mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl b/installer/data/mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl index 72a7d2751d..1834f96dc4 100755 --- a/installer/data/mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl +++ b/installer/data/mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl @@ -7,8 +7,7 @@ return { my ($args) = @_; my ($dbh, $out) = @$args{qw(dbh out)}; - if( TableExists( 'recalls' ) and column_exists( 'recalls', 'recall_id' ) ) { - $dbh->do(q{ ALTER TABLE recalls CHANGE COLUMN recall_id id int(11) NOT NULL AUTO_INCREMENT }); + if( TableExists( 'recalls' ) and column_exists( 'recalls', 'borrowernumber' ) ) { $dbh->do(q{ ALTER TABLE recalls CHANGE COLUMN borrowernumber patron_id int(11) NOT NULL DEFAULT 0 }); $dbh->do(q{ ALTER TABLE recalls CHANGE COLUMN recalldate created_date datetime DEFAULT NULL }); $dbh->do(q{ ALTER TABLE recalls CHANGE COLUMN biblionumber biblio_id int(11) NOT NULL DEFAULT 0 }); diff --git a/installer/data/mysql/kohastructure.sql b/installer/data/mysql/kohastructure.sql index 00417e5b92..d8b9725bea 100644 --- a/installer/data/mysql/kohastructure.sql +++ b/installer/data/mysql/kohastructure.sql @@ -4288,7 +4288,7 @@ CREATE TABLE `ratings` ( DROP TABLE IF EXISTS recalls; CREATE TABLE recalls ( - id int(11) NOT NULL AUTO_INCREMENT COMMENT "Unique identifier for this recall", + 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", @@ -4303,7 +4303,7 @@ CREATE TABLE recalls ( 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 (id), + PRIMARY KEY (recall_id), KEY recalls_ibfk_1 (patron_id), KEY recalls_ibfk_2 (biblio_id), KEY recalls_ibfk_3 (item_id), -- 2.20.1