customer/migrations/0008_content.sql
Peppa 66eae294cf
All checks were successful
peppa/lint lint: success за 1с
peppa/typecheck typecheck: success за 1с
peppa/test test: success за 31с
peppa/build build: success за 1с
ci / checks (pull_request) Successful in 44s
deploy / deploy (pull_request) Successful in 3s
CLT-9: контент-агент — блог, автопостинг в Telegram, UTM и QR
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-15 14:58:29 +05:00

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);