b90ff252d1
Public archive with sidebar navigation, project pages, month archive, search and entry pages with image blocks. Admin area for brands, projects, post types, users, api clients, media and the entry editor with drag and drop images, preview per audience, scheduling and publish checks. Read and write API with bearer tokens, audience scoping, idempotent creation, OpenAPI document and editorial guide. Magic link login with configurable allowed domains, whole app behind the session gate. 456 tests including design rule checks.
24 lines
950 B
SQL
24 lines
950 B
SQL
CREATE TABLE "brand" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"slug" text NOT NULL,
|
|
"name" text NOT NULL,
|
|
"color" text DEFAULT '#191c20' NOT NULL,
|
|
"sort" integer DEFAULT 0 NOT NULL,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
CONSTRAINT "brand_slug_unique" UNIQUE("slug")
|
|
);
|
|
--> statement-breakpoint
|
|
CREATE TABLE "project" (
|
|
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
|
"brand_id" uuid NOT NULL,
|
|
"slug" text NOT NULL,
|
|
"name" text NOT NULL,
|
|
"description" text,
|
|
"color" text DEFAULT '#191c20' NOT NULL,
|
|
"is_active" boolean DEFAULT true NOT NULL,
|
|
"sort" integer DEFAULT 0 NOT NULL,
|
|
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
|
CONSTRAINT "project_slug_unique" UNIQUE("slug")
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "project" ADD CONSTRAINT "project_brand_id_brand_id_fk" FOREIGN KEY ("brand_id") REFERENCES "public"."brand"("id") ON DELETE restrict ON UPDATE no action; |