mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-26 17:01:04 -06:00
Add UNIQUE constraint in the states table for the pg backend
This commit is contained in:
parent
3bf053a5fc
commit
b8e0d6f418
@ -111,7 +111,7 @@ func (b *Backend) configure(ctx context.Context) error {
|
|||||||
|
|
||||||
query = `CREATE TABLE IF NOT EXISTS %s.%s (
|
query = `CREATE TABLE IF NOT EXISTS %s.%s (
|
||||||
id bigint NOT NULL DEFAULT nextval('public.global_states_id_seq') PRIMARY KEY,
|
id bigint NOT NULL DEFAULT nextval('public.global_states_id_seq') PRIMARY KEY,
|
||||||
name text,
|
name text UNIQUE,
|
||||||
data text
|
data text
|
||||||
)`
|
)`
|
||||||
if _, err := db.Exec(fmt.Sprintf(query, b.schemaName, statesTableName)); err != nil {
|
if _, err := db.Exec(fmt.Sprintf(query, b.schemaName, statesTableName)); err != nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user