diff --git a/bin/diffdb.pl b/bin/diffdb.pl deleted file mode 100644 index d1b6b4d7..00000000 --- a/bin/diffdb.pl +++ /dev/null @@ -1,30 +0,0 @@ -use strict; -use warnings; -use 5.010; -use DBI; -use Config::JSON; -use Text::Diff; -my $config = Config::JSON->new('/data/Lacuna-Server/etc/lacuna.conf'); -my $dev = DBI->connect($config->get('db/dsn'), $config->get('db/username'), $config->get('db/password')); -my $prod = DBI->connect('DBI:mysql:prod', $config->get('db/username'), $config->get('db/password')); - -my @dev_tables = @{$dev->selectcol_arrayref("show tables")}; -my @prod_tables = @{$prod->selectcol_arrayref("show tables")}; -foreach my $table_name (@dev_tables) { - say "TABLE: ".$table_name; - my $dev_table = get_table_definition($dev, $table_name); - my $prod_table = ''; - if ($table_name ~~ \@prod_tables) { - $prod_table = get_table_definition($prod, $table_name); - } - say diff \$prod_table, \$dev_table; -} - -$dev->disconnect; -$prod->disconnect; - - -sub get_table_definition { - my ($db, $name) = @_; - return $db->selectrow_arrayref("show create table $name")->[1]; -} diff --git a/bin/get_building_stats.pl b/bin/util/get_building_stats.pl similarity index 100% rename from bin/get_building_stats.pl rename to bin/util/get_building_stats.pl