@@ -, +, @@ --- .../mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl | 3 +-- installer/data/mysql/kohastructure.sql | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) --- a/installer/data/mysql/atomicupdate/bug_30291_-_rename_recalls_columns.pl +++ a/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 }); --- a/installer/data/mysql/kohastructure.sql +++ a/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), --