2022-12-11 20:44:06 +01:00
|
|
|
CREATE TABLE likes (
|
2022-12-25 15:57:33 +01:00
|
|
|
iri VARCHAR,
|
2022-12-11 20:44:06 +01:00
|
|
|
note_id BIGINT REFERENCES notes (id) ON DELETE CASCADE,
|
|
|
|
account_id BIGINT REFERENCES accounts (id) ON DELETE CASCADE,
|
2023-01-20 16:45:12 +01:00
|
|
|
created_at TIMESTAMP NOT NULL DEFAULT now(),
|
|
|
|
CONSTRAINT likes_pkey PRIMARY KEY (note_id, account_id)
|
2022-12-11 20:44:06 +01:00
|
|
|
);
|
|
|
|
|
2022-12-25 15:57:33 +01:00
|
|
|
CREATE UNIQUE INDEX index_likes_on_iri ON likes (iri);
|