From cda5cac8f34f5910a201705f7738044ea752f26c Mon Sep 17 00:00:00 2001 From: Yaron Schneider Date: Wed, 21 Feb 2024 10:05:45 -0800 Subject: [PATCH] [1.13] fix: create table for migration only if not exists (#3356) (#3357) Signed-off-by: Samantha Coyle Co-authored-by: Sam --- 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(),