Files
sase.tr/apps/api/drizzle/0008_common_sumo.sql
Semih Yesilyurt 6e9223b277 feat(blog): drizzle migration 0008 — blog_posts table
Generated for the blog_posts schema added in the previous commit. Applied on
deploy by start.sh (db:migrate). CREATE TABLE + 3 indexes only; no changes to
existing tables.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 17:40:10 +03:00

18 lines
900 B
SQL

CREATE TABLE "blog_posts" (
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
"slug" varchar(180) NOT NULL,
"title" varchar(255) NOT NULL,
"meta_description" varchar(320),
"body_markdown" text NOT NULL,
"tags" jsonb DEFAULT '[]'::jsonb NOT NULL,
"cover_image" varchar(500),
"status" varchar(20) DEFAULT 'published' NOT NULL,
"source" varchar(20) DEFAULT 'panel' NOT NULL,
"published_at" timestamp with time zone DEFAULT now() NOT NULL,
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
"updated_at" timestamp with time zone DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX "blog_posts_slug_idx" ON "blog_posts" USING btree ("slug");--> statement-breakpoint
CREATE INDEX "blog_posts_published_at_idx" ON "blog_posts" USING btree ("published_at");--> statement-breakpoint
CREATE INDEX "blog_posts_status_idx" ON "blog_posts" USING btree ("status");