## No source databases? Does not compute!
if ($role{source} < 1) {
- die "Invalid database group: at least one database must hav a role of 'source'!\n";
+ die "Invalid database group: at least one database must have a role of 'source'!\n";
}
## If we have at least one target (or more than one source), we must have PKs on each table
die qq{Could not find a sync named "$name"\nUse 'list syncs' to see all available.};
}
- ## Now we can react to the first 'verb' word
- my $verb = lc shift @actions;
-
## Adding something to this sync
if ('add' eq $verb or 'insert' eq $verb) {
}
}
return;
+
} ## end of 'add'
## Removing something from this sync
## Changing something about this sync
if ('update' eq $verb or 'change' eq $verb) {
+ for my $n (@nouns) {
+ if ($n =~ /status=(.+)/) {
+ my $onoff = $1;
+ my $status = $onoff =~ /active|on/ ? 'Active' : 'Inactive';
+ $SQL = 'UPDATE sync SET status = ? WHERE name = ?';
+ $sth = $dbh->prepare($SQL);
+ $sth->execute($status, $name);
+ $dbh->commit();
+ }
+ }
return;
}