Add UNIQUE constraint in the states table for the pg backend

This commit is contained in:
Rémi Lapeyre 2021-07-14 11:59:14 +02:00
parent 3bf053a5fc
commit b8e0d6f418
1 changed files with 1 additions and 1 deletions

View File

@ -111,7 +111,7 @@ func (b *Backend) configure(ctx context.Context) error {
query = `CREATE TABLE IF NOT EXISTS %s.%s (
id bigint NOT NULL DEFAULT nextval('public.global_states_id_seq') PRIMARY KEY,
name text,
name text UNIQUE,
data text
)`
if _, err := db.Exec(fmt.Sprintf(query, b.schemaName, statesTableName)); err != nil {