From e766eb0531202ed1e82c7fc854757f97df5c68f0 Mon Sep 17 00:00:00 2001 From: Johannes Rauh Date: Fri, 10 Jan 2025 09:42:35 +0100 Subject: [PATCH] Empty table before adding primary key The addition of the primary key can cause problems for populated tables due to duplicate entries. Therefore we delete the existing data before adding the primary key. --- schema/mysql-migrations/upgrade_59.sql | 2 ++ 1 file changed, 2 insertions(+) diff --git a/schema/mysql-migrations/upgrade_59.sql b/schema/mysql-migrations/upgrade_59.sql index bf94d089..51f18265 100644 --- a/schema/mysql-migrations/upgrade_59.sql +++ b/schema/mysql-migrations/upgrade_59.sql @@ -1,3 +1,5 @@ +DELETE FROM vspheredb_daemonlog; + ALTER TABLE vspheredb_daemonlog ADD PRIMARY KEY (instance_uuid, ts_create);