View | Details | Raw Unified | Return to bug 22784
Collapse All | Expand All

(-)a/Koha/Schema/Result/Suggestion.pm (+4 lines)
Lines 491-496 __PACKAGE__->belongs_to( Link Here
491
  },
491
  },
492
);
492
);
493
493
494
__PACKAGE__->add_columns(
495
    '+archived' => { is_boolean => 1 },
496
);
497
494
sub koha_objects_class {
498
sub koha_objects_class {
495
    'Koha::Suggestions';
499
    'Koha::Suggestions';
496
}
500
}
(-)a/installer/data/mysql/atomicupdate/bug_22784.perl (+11 lines)
Line 0 Link Here
1
$DBversion = 'XXX'; # will be replaced by the RM
2
if( CheckVersion( $DBversion ) ) {
3
    if( !column_exists( 'suggestions', 'archived' ) ) {
4
        $dbh->do(q|
5
            ALTER TABLE suggestions ADD COLUMN archived INT(1) NOT NULL DEFAULT 0 AFTER `STATUS`;
6
        |);
7
    }
8
9
    SetVersion( $DBversion );
10
    print "Upgrade to $DBversion done (Bug 22784 - Add a new suggestions.archived column)\n";
11
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +1 lines)
Lines 3013-3018 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
3013
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3013
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3014
   lastmodificationdate date default NULL, -- date of the last modification
3014
   lastmodificationdate date default NULL, -- date of the last modification
3015
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3015
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3016
  `archived` INT(1) NOT NULL DEFAULT 0, -- is the suggestion archived?
3016
  `note` LONGTEXT, -- note entered on the suggestion
3017
  `note` LONGTEXT, -- note entered on the suggestion
3017
  `author` varchar(80) default NULL, -- author of the suggested item
3018
  `author` varchar(80) default NULL, -- author of the suggested item
3018
  `title` varchar(255) default NULL, -- title of the suggested item
3019
  `title` varchar(255) default NULL, -- title of the suggested item
3019
- 

Return to bug 22784