Bug 22785: DBRev 21.12.00.046
[koha.git] / installer / data / mysql / db_revs / 211200040.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => 30565,
5     description => "Update table stockrotationrotas",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9         if( !unique_key_exists('stockrotationrotas', 'stockrotationrotas_title') ) {
10             $dbh->do( q|
11 ALTER TABLE stockrotationrotas ADD CONSTRAINT UNIQUE KEY stockrotationrotas_title (title)
12             |);
13         }
14         # Make sure that description is NOT NULL
15         $dbh->do( q|
16 ALTER TABLE stockrotationrotas MODIFY COLUMN description text NOT NULL COMMENT 'Description for this rota'
17         |);
18     },
19 };