mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
21 lines
832 B
PL/PgSQL
Executable file
21 lines
832 B
PL/PgSQL
Executable file
-- Type: DO
|
|
-- Name: library_item_preview
|
|
-- Description: Create library_item_preview table
|
|
|
|
BEGIN;
|
|
|
|
CREATE TABLE omnivore.library_item_preview (
|
|
id uuid PRIMARY KEY DEFAULT uuid_generate_v1mc(),
|
|
sender_id uuid NOT NULL REFERENCES omnivore.user ON DELETE CASCADE,
|
|
recipient_ids uuid[] NOT NULL, -- Array of user ids
|
|
library_item_id uuid NOT NULL REFERENCES omnivore.library_item(id) ON DELETE CASCADE,
|
|
thumbnail text,
|
|
includes_note bool NOT NULL DEFAULT false,
|
|
includes_highlight bool NOT NULL DEFAULT false,
|
|
created_at timestamptz NOT NULL DEFAULT current_timestamp,
|
|
updated_at timestamptz NOT NULL DEFAULT current_timestamp
|
|
);
|
|
|
|
CREATE TRIGGER update_library_item_preview_modtime BEFORE UPDATE ON omnivore.library_item_preview FOR EACH ROW EXECUTE PROCEDURE update_updated_at_column();
|
|
|
|
COMMIT;
|