Skip to main content

max / multithreaded

350 B · 11 lines History Blame Raw
1 CREATE TABLE link_previews (
2 id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
3 post_id UUID NOT NULL REFERENCES posts(id) ON DELETE CASCADE,
4 url TEXT NOT NULL,
5 title TEXT,
6 description TEXT,
7 fetched_at TIMESTAMPTZ NOT NULL DEFAULT now(),
8 UNIQUE (post_id, url)
9 );
10 CREATE INDEX idx_link_previews_post ON link_previews(post_id);
11