Bug 31673: (bug 31086 follow-up) Drop and constraint to allow updating column
[koha.git] / installer / data / mysql / db_revs / 220600036.pl
1 use Modern::Perl;
2
3 return {
4     bug_number => "31017",
5     description => "Add type option to vendors",
6     up => sub {
7         my ($args) = @_;
8         my ($dbh, $out) = @$args{qw(dbh out)};
9         unless( column_exists('aqbooksellers','type') ){
10             $dbh->do(q{
11                 ALTER TABLE aqbooksellers ADD COLUMN type varchar(255) DEFAULT NULL AFTER accountnumber
12             });
13             say $out "Added type column to aqbooksellers";
14         }
15         $dbh->do(q{
16             INSERT IGNORE INTO authorised_value_categories( category_name, is_system ) VALUES ('VENDOR_TYPE', 1);
17         });
18         say $out "Added VENDOR_TYPE authorised value category";
19     },
20 };