Skip to content

Commit

Permalink
fix: create table for migration only if not exists (#3356)
Browse files Browse the repository at this point in the history
Signed-off-by: Samantha Coyle <[email protected]>
  • Loading branch information
sicoyle authored and yaron2 committed Feb 21, 2024
1 parent dd4db99 commit 8e4e710
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion state/postgresql/v2/postgresql.go
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down

0 comments on commit 8e4e710

Please sign in to comment.