2022-05-06 13:38:02 +00:00
|
|
|
CREATE TABLE IF NOT EXISTS "contacts" (
|
|
|
|
"id" SERIAL PRIMARY KEY,
|
2022-05-06 20:33:23 +00:00
|
|
|
"user_id_a" INTEGER REFERENCES users (id) NOT NULL,
|
|
|
|
"user_id_b" INTEGER REFERENCES users (id) NOT NULL,
|
|
|
|
"a_to_b" BOOLEAN NOT NULL,
|
2022-05-06 22:44:47 +00:00
|
|
|
"should_notify" BOOLEAN NOT NULL,
|
2022-05-06 20:33:23 +00:00
|
|
|
"accepted" BOOLEAN NOT NULL
|
2022-05-06 13:38:02 +00:00
|
|
|
);
|
|
|
|
|
2022-05-06 20:33:23 +00:00
|
|
|
CREATE UNIQUE INDEX "index_contacts_user_ids" ON "contacts" ("user_id_a", "user_id_b");
|
|
|
|
CREATE INDEX "index_contacts_user_id_b" ON "contacts" ("user_id_b");
|