mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-06 22:43:10 -06:00
If not exists
This commit is contained in:
parent
d5504eb29c
commit
5f5356a909
|
|
@ -190,14 +190,14 @@ const eventStateKeysSchema = `
|
||||||
-- Well known state keys are pre-assigned numeric IDs:
|
-- Well known state keys are pre-assigned numeric IDs:
|
||||||
-- 1 -> "" (the empty string)
|
-- 1 -> "" (the empty string)
|
||||||
CREATE SEQUENCE IF NOT EXISTS event_state_key_nid_seq START 65536;
|
CREATE SEQUENCE IF NOT EXISTS event_state_key_nid_seq START 65536;
|
||||||
CREATE TABLE event_state_keys (
|
CREATE TABLE IF NOT EXISTS event_state_keys (
|
||||||
-- Local numeric ID for the state key.
|
-- Local numeric ID for the state key.
|
||||||
event_state_key_nid BIGINT PRIMARY KEY DEFAULT nextval('event_state_key_nid_seq'),
|
event_state_key_nid BIGINT PRIMARY KEY DEFAULT nextval('event_state_key_nid_seq'),
|
||||||
event_state_key TEXT NOT NULL CONSTRAINT event_state_key_unique UNIQUE
|
event_state_key TEXT NOT NULL CONSTRAINT event_state_key_unique UNIQUE
|
||||||
);
|
);
|
||||||
INSERT INTO event_state_keys (event_state_key_nid, event_state_key) VALUES (
|
INSERT INTO event_state_keys (event_state_key_nid, event_state_key) VALUES (
|
||||||
(1, '')
|
(1, '')
|
||||||
);
|
) ON CONFLICT DO NOTHING;
|
||||||
`
|
`
|
||||||
|
|
||||||
const insertEventStateKeyNIDSQL = "" +
|
const insertEventStateKeyNIDSQL = "" +
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue