17 lines
687 B
SQL
17 lines
687 B
SQL
CREATE TABLE content_posts (
|
|
id uuid PRIMARY KEY,
|
|
slug text NOT NULL UNIQUE,
|
|
title text NOT NULL,
|
|
summary text NOT NULL,
|
|
body text NOT NULL,
|
|
topic text NOT NULL CHECK (topic IN ('case', 'mistakes', 'empathy', 'speech-analytics')),
|
|
cta_product text,
|
|
status text NOT NULL DEFAULT 'draft' CHECK (status IN ('draft', 'approved', 'published')),
|
|
publish_at timestamptz,
|
|
published_at timestamptz,
|
|
tg_status text NOT NULL DEFAULT 'skipped' CHECK (tg_status IN ('skipped', 'pending', 'sent', 'failed')),
|
|
tg_attempts integer NOT NULL DEFAULT 0,
|
|
created_at timestamptz NOT NULL DEFAULT now()
|
|
);
|
|
CREATE INDEX content_posts_status_idx ON content_posts (status, publish_at);
|