fix script
parent
8aa2cddb78
commit
3cfcef2ee6
|
@ -27,16 +27,14 @@ binmode STDOUT, ":utf8";
|
|||
my @migrations = glob ("migrations/*sql");
|
||||
foreach my $migration (@migrations){
|
||||
my $sth = RSSTootalizer::DB->doSELECT("SELECT * FROM migrations WHERE name = ?", $migration);
|
||||
if (!$sth){
|
||||
if (scalar(@$sth) == 0){
|
||||
print "Running migration $migration\n";
|
||||
open (M, "<", $migration);
|
||||
my $sql = "";
|
||||
while (<M>){
|
||||
chomp;
|
||||
print "Read: $_\n";
|
||||
$sql .= $_;
|
||||
if ($sql =~ /;/){
|
||||
print "Running: $sql\n";
|
||||
RSSTootalizer::DB->doDELETE($sql); # Using doDELETE for lack of error handling...
|
||||
$sql = "";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue