From 8e4e71024dd4292c3ffc093d89c43bb59646d6f6 Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 20 Feb 2024 15:50:42 -0600 Subject: [PATCH] fix: create table for migration only if not exists (#3356) Signed-off-by: Samantha Coyle --- state/postgresql/v2/postgresql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/state/postgresql/v2/postgresql.go b/state/postgresql/v2/postgresql.go index 1cbb537d85..06449c0278 100644 --- a/state/postgresql/v2/postgresql.go +++ b/state/postgresql/v2/postgresql.go @@ -158,7 +158,7 @@ func (p *PostgreSQL) performMigrations(ctx context.Context) error { p.logger.Infof("Creating state table: '%s'", stateTable) _, err := p.db.Exec(ctx, fmt.Sprintf(` -CREATE TABLE %[1]s ( +CREATE TABLE IF NOT EXISTS %[1]s ( key text NOT NULL PRIMARY KEY, value bytea NOT NULL, etag uuid NOT NULL DEFAULT gen_random_uuid(),