From f44ef3fa2576a1e20b11da6d26256edb962a45b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Graber?= Date: Wed, 25 Oct 2023 22:58:44 -0400 Subject: [PATCH] cmd/lxd-to-incus: Fix SQL update for multiple pools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Stéphane Graber --- cmd/lxd-to-incus/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/lxd-to-incus/main.go b/cmd/lxd-to-incus/main.go index b80a7a69c79..4a40ea2d7db 100644 --- a/cmd/lxd-to-incus/main.go +++ b/cmd/lxd-to-incus/main.go @@ -478,7 +478,7 @@ func (c *cmdMigrate) Run(app *cobra.Command, args []string) error { } newSource := strings.Replace(source, sourcePaths.Daemon, targetPaths.Daemon, 1) - rewriteStatements = append(rewriteStatements, fmt.Sprintf("UPDATE storage_pools_config SET value='%s' WHERE value='%s'", newSource, source)) + rewriteStatements = append(rewriteStatements, fmt.Sprintf("UPDATE storage_pools_config SET value='%s' WHERE value='%s';", newSource, source)) } // Confirm migration. @@ -557,7 +557,7 @@ Instances will come back online once the migration is complete. } // Apply custom SQL statements. - err = os.WriteFile(filepath.Join(targetPaths.Daemon, "database", "patch.global.sql"), []byte(strings.Join(rewriteStatements, "\n")), 0600) + err = os.WriteFile(filepath.Join(targetPaths.Daemon, "database", "patch.global.sql"), []byte(strings.Join(rewriteStatements, "\n")+"\n"), 0600) if err != nil { return fmt.Errorf("Failed to write database path: %w", err) }