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 2999-3004 CREATE TABLE `suggestions` ( -- purchase suggestions Link Here
2999
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
2999
   lastmodificationby INT(11) default NULL, -- borrowernumber for the librarian who edit the suggestion for the last time
3000
   lastmodificationdate date default NULL, -- date of the last modification
3000
   lastmodificationdate date default NULL, -- date of the last modification
3001
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3001
  `STATUS` varchar(10) NOT NULL default '', -- suggestion status (ASKED, CHECKED, ACCEPTED, or REJECTED)
3002
  `archived` INT(1) NOT NULL DEFAULT 0, -- is the suggestion archived?
3002
  `note` LONGTEXT, -- note entered on the suggestion
3003
  `note` LONGTEXT, -- note entered on the suggestion
3003
  `author` varchar(80) default NULL, -- author of the suggested item
3004
  `author` varchar(80) default NULL, -- author of the suggested item
3004
  `title` varchar(255) default NULL, -- title of the suggested item
3005
  `title` varchar(255) default NULL, -- title of the suggested item
3005
- 

Return to bug 22784