From dd9d5e6ba0cd98cd2d6902970d4fb6e172bbacf0 Mon Sep 17 00:00:00 2001 From: Digimer Date: Fri, 1 Apr 2022 17:04:54 -0400 Subject: [PATCH] Updated resync to no longer be tied to a host_uuid. Signed-off-by: Digimer --- Anvil/Tools/Database.pm | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/Anvil/Tools/Database.pm b/Anvil/Tools/Database.pm index 98a23f23..3d88b40a 100644 --- a/Anvil/Tools/Database.pm +++ b/Anvil/Tools/Database.pm @@ -16053,11 +16053,12 @@ sub resync_databases $query =~ s/, $/ /; $query .= "FROM ".$schema.".".$table; - # Restrict to this host if a host column was found. - if ($host_column) - { - $query .= " WHERE ".$host_column." = ".$anvil->Database->quote($anvil->data->{sys}{host_uuid}); - } + ### NOTE: No longer restricting to the host, given only the strikers can do resyncs now. +# # Restrict to this host if a host column was found. +# if ($host_column) +# { +# $query .= " WHERE ".$host_column." = ".$anvil->Database->quote($anvil->data->{sys}{host_uuid}); +# } $query .= " ORDER BY utc_modified_date DESC;"; $anvil->Log->entry({source => $THIS_FILE, line => __LINE__, level => $debug, key => "log_0074", variables => { uuid => $uuid, query => $query }}); @@ -17774,18 +17775,19 @@ sub _find_behind_databases "database::${uuid}::password" => $anvil->Log->is_secure($anvil->data->{database}{$uuid}{password}), }}); + ### Only Strikers resync, so limiting to the host_uuid doesn't make sense anymore. my $schema = $has_history ? "history" : "public"; $query = " SELECT DISTINCT round(extract(epoch from modified_date)) AS unix_modified_date FROM ".$schema.".".$table." "; - if ($host_column) - { - $query .= " -WHERE - ".$host_column." = ".$anvil->Database->quote($anvil->data->{sys}{host_uuid}) ; - } +# if ($host_column) +# { +# $query .= " +# WHERE +# ".$host_column." = ".$anvil->Database->quote($anvil->data->{sys}{host_uuid}) ; +# } $query .= " ORDER BY unix_modified_date DESC