@@ -, +, @@ --- Koha/Schema/Result/Suggestion.pm | 4 +++- installer/data/mysql/atomicupdate/bug_22784.perl | 11 +++++++++++ installer/data/mysql/kohastructure.sql | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 installer/data/mysql/atomicupdate/bug_22784.perl --- a/Koha/Schema/Result/Suggestion.pm +++ a/Koha/Schema/Result/Suggestion.pm @@ -479,6 +479,8 @@ __PACKAGE__->belongs_to( # Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-11-14 15:44:38 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qZuiiZgd+ry97OSngYckSA +__PACKAGE__->add_columns( + '+archived' => { is_boolean => 1 }, +); -# You can replace this text with custom content, and it will be preserved on regeneration 1; --- a/installer/data/mysql/atomicupdate/bug_22784.perl +++ a/installer/data/mysql/atomicupdate/bug_22784.perl @@ -0,0 +1,11 @@ +$DBversion = 'XXX'; # will be replaced by the RM +if( CheckVersion( $DBversion ) ) { + if( !column_exists( 'suggestions', 'archived' ) ) { + $dbh->do(q| + ALTER TABLE suggestions ADD COLUMN archived INT(1) NOT NULL DEFAULT 0 AFTER `STATUS`; + |); + } + + SetVersion( $DBversion ); + print "Upgrade to $DBversion done (Bug 22784 - Add a new suggestions.archived column)\n"; +} --- a/installer/data/mysql/kohastructure.sql +++ a/installer/data/mysql/kohastructure.sql @@ -3029,6 +3029,7 @@ CREATE TABLE `suggestions` ( -- purchase suggestions lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time lastmodificationdate date default NULL, -- date of the last modification `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED) + `archived` INT(1) NOT NULL DEFAULT 0, -- is the suggestion archived? `note` LONGTEXT, -- note entered on the suggestion `author` varchar(80) default NULL, -- author of the suggested item `title` varchar(255) default NULL, -- title of the suggested item --