« auto/share/dist/Zonemaster-Backend/patch/patch_mysql_db_zonemaster_backend_ver_5.0.0.pl
↑ Summary
auto/share/dist/Zonemaster-Backend/patch/patch_postgresql_db_zonemaster_backend_ver_1.0.3.pl »
| 1 | use strict; | ||
| 2 | use warnings; | ||
| 3 | |||
| 4 | use DBI qw(:utils); | ||
| 5 | |||
| 6 | use Zonemaster::Backend::Config; | ||
| 7 | use Zonemaster::Backend::DB::MySQL; | ||
| 8 | |||
| 9 | my $config = Zonemaster::Backend::Config->load_config(); | ||
| 10 | if ( $config->DB_engine ne 'MySQL' ) { | ||
| 11 | die "The configuration file does not contain the MySQL backend"; | ||
| 12 | } | ||
| 13 | my $dbh = Zonemaster::Backend::DB::MySQL->from_config( $config )->dbh; | ||
| 14 | |||
| 15 | sub patch_db { | ||
| 16 | ############################################################################ | ||
| 17 | # Convert column "results" to MEDIUMBLOB so that it can hold larger results | ||
| 18 | ############################################################################ | ||
| 19 | $dbh->do( 'ALTER TABLE test_results MODIFY results mediumblob' ); | ||
| 20 | } | ||
| 21 | |||
| 22 | patch_db(); |