1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00

Add ability to merge

This commit is contained in:
sjaanus 2022-10-27 15:12:29 +03:00
parent 2effc20378
commit 504e7e796e
No known key found for this signature in database
GPG Key ID: 20E007C0248BA7FF
2 changed files with 4 additions and 1 deletions

View File

@ -230,6 +230,8 @@ export class SuggestChangeStore implements ISuggestChangeStore {
suggest_change_set_id: changeSetID,
created_by: userId,
})
.onConflict(['action', 'suggest_change_set_id', 'feature'])
.merge()
.returning('id');
};

View File

@ -19,7 +19,8 @@ CREATE TABLE IF NOT EXISTS suggest_change (
payload jsonb not null default '[]'::jsonb,
created_by integer not null references users (id) ON DELETE CASCADE,
created_at timestamp default now(),
suggest_change_set_id integer NOT NULL REFERENCES suggest_change_set(id) ON DELETE CASCADE
suggest_change_set_id integer NOT NULL REFERENCES suggest_change_set(id) ON DELETE CASCADE,
UNIQUE (feature, action, suggest_change_set_id)
);
`,
callback,