Quick cleanups.
authorGreg Sabino Mullane <greg@endpoint.com>
Sat, 28 May 2011 03:25:25 +0000 (23:25 -0400)
committerGreg Sabino Mullane <greg@endpoint.com>
Sat, 28 May 2011 03:25:25 +0000 (23:25 -0400)
bucardo.schema
bucardo_ctl

index 95d3c1bff3218808b778eebb7e1e7bd70ce42952..89c79c2198adf6ff033f71906f4be102ce7022b2 100644 (file)
@@ -1093,7 +1093,7 @@ for (@{$rv->{rows}}) {
 
 ## 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
index e62facd3251c33d52e00ccfb2f9c6bab57dc41f5..f73295410c9df2e33fe8e2869a4b0f58591bcf39 100755 (executable)
@@ -2683,9 +2683,6 @@ sub update_sync {
         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) {
 
@@ -2725,6 +2722,7 @@ sub update_sync {
             }
         }
         return;
+
     } ## end of 'add'
 
     ## Removing something from this sync
@@ -2734,6 +2732,16 @@ sub update_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;
     }