@@ -, +, @@ --- .../data/mysql/atomicupdate/bug_30565.pl | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 installer/data/mysql/atomicupdate/bug_30565.pl --- a/installer/data/mysql/atomicupdate/bug_30565.pl +++ a/installer/data/mysql/atomicupdate/bug_30565.pl @@ -0,0 +1,19 @@ +use Modern::Perl; + +return { + bug_number => 30565, + description => "Update table stockrotationrotas", + up => sub { + my ($args) = @_; + my ($dbh, $out) = @$args{qw(dbh out)}; + if( !unique_key_exists('stockrotationrotas', 'stockrotationrotas_title') ) { + $dbh->do( q| +ALTER TABLE stockrotationrotas ADD CONSTRAINT UNIQUE KEY stockrotationrotas_title (title) + |); + } + # Make sure that description is NOT NULL + $dbh->do( q| +ALTER TABLE stockrotationrotas MODIFY COLUMN description text NOT NULL COMMENT 'Description for this rota' + |); + }, +}; --