From 4caa133a44ab199d8f848f27016d8d68aaa8f4b2 Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 2 Jan 2024 15:57:31 +0000 Subject: [PATCH] Bug 35682: [TEST ONLY]: This is a dummy dbrev to force an update --- installer/data/mysql/db_revs/231200003.pl | 59 +++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100755 installer/data/mysql/db_revs/231200003.pl diff --git a/installer/data/mysql/db_revs/231200003.pl b/installer/data/mysql/db_revs/231200003.pl new file mode 100755 index 0000000000..1dcc34491e --- /dev/null +++ b/installer/data/mysql/db_revs/231200003.pl @@ -0,0 +1,59 @@ +use Modern::Perl; + +use Term::ANSIColor qw(:constants); + +return { + bug_number => "35539", + description => "Remove unused columns from 'categories' table", + up => sub { + my ($args) = @_; + my ( $dbh, $out ) = @$args{qw(dbh out)}; + + if ( column_exists( 'categories', 'bulk' ) ) { + my ($bulkdata) = $dbh->selectrow_array( + q| + SELECT bulk FROM categories; + | + ); + if ($bulkdata) { + say $out YELLOW, + "Data was found in 'bulk' column in 'categories' table. Please remove this data and run the update again."; + } else { + $dbh->do("ALTER TABLE categories DROP COLUMN bulk"); + say $out "Removed 'bulk' column from 'categories' table"; + } + } + + if ( column_exists( 'categories', 'finetype' ) ) { + my ($bulkdata) = $dbh->selectrow_array( + q| + SELECT finetype FROM categories; + | + ); + if ($bulkdata) { + say $out YELLOW, + "Data was found in 'finetype' column in 'categories' table. Please remove this data and run the update again."; + } else { + $dbh->do("ALTER TABLE categories DROP COLUMN finetype"); + say $out "Removed 'finetype' column from 'categories' table"; + } + } + + if ( column_exists( 'categories', 'issuelimit' ) ) { + my ($bulkdata) = $dbh->selectrow_array( + q| + SELECT issuelimit FROM categories; + | + ); + if ($bulkdata) { + say $out YELLOW, + "Data was found in 'issuelimit' column in 'categories' table. Please remove this data and run the update again."; + } else { + $dbh->do("ALTER TABLE categories DROP COLUMN issuelimit"); + say $out "Removed 'issuelimit' column from 'categories' table"; + } + } + + say $out WHITE, "Bug 35539: All done."; + }, +}; -- 2.30.2