From 55aede2762134ef9d6df99b26c8c6fcd36cda2e0 Mon Sep 17 00:00:00 2001 From: Sasha Krassovsky Date: Tue, 9 Jan 2024 16:23:51 -0800 Subject: [PATCH] Prevnet duplicate insertions --- compute_tools/src/spec.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/compute_tools/src/spec.rs b/compute_tools/src/spec.rs index a075edb8fc..23a63c4f95 100644 --- a/compute_tools/src/spec.rs +++ b/compute_tools/src/spec.rs @@ -763,10 +763,10 @@ END $$; let mut query = "CREATE SCHEMA IF NOT EXISTS neon_migration"; client.simple_query(query)?; - query = "CREATE TABLE IF NOT EXISTS neon_migration.migration_id (id bigint NOT NULL DEFAULT 0)"; + query = "CREATE TABLE IF NOT EXISTS neon_migration.migration_id (key INT NOT NULL PRIMARY KEY, id bigint NOT NULL DEFAULT 0)"; client.simple_query(query)?; - query = "INSERT INTO neon_migration.migration_id VALUES (0) ON CONFLICT DO NOTHING"; + query = "INSERT INTO neon_migration.migration_id VALUES (0, 0) ON CONFLICT DO NOTHING"; client.simple_query(query)?; query = "ALTER SCHEMA neon_migration OWNER TO cloud_admin";