mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
19 lines
629 B
PL/PgSQL
Executable file
19 lines
629 B
PL/PgSQL
Executable file
-- Type: DO
|
|
-- Name: recommendation
|
|
-- Description: Create recommendation table
|
|
|
|
BEGIN;
|
|
|
|
CREATE TABLE omnivore.recommendation (
|
|
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
|
|
library_item_id uuid NOT NULL REFERENCES omnivore.library_item ON DELETE CASCADE,
|
|
recommender_id uuid NOT NULL REFERENCES omnivore.user ON DELETE CASCADE,
|
|
group_id uuid NOT NULL REFERENCES omnivore.group ON DELETE CASCADE,
|
|
note text,
|
|
created_at timestamptz NOT NULL DEFAULT current_timestamp,
|
|
UNIQUE (library_item_id, recommender_id, group_id)
|
|
);
|
|
|
|
GRANT SELECT, INSERT ON omnivore.recommendation TO omnivore_user;
|
|
|
|
COMMIT;
|