Skip to content

Commit a2b86ed

Browse files
Merge pull request #61 from curehht/feature/documents
Feature/documents
2 parents aadb4d6 + d1dc554 commit a2b86ed

25 files changed

Lines changed: 2510 additions & 97 deletions

.eslintrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": [
3+
"next/core-web-vitals",
4+
"next/typescript"
5+
]
6+
}

drizzle/0005_icy_random.sql

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
CREATE TABLE "document_blocks" (
2+
"id" text PRIMARY KEY NOT NULL,
3+
"document_id" text NOT NULL,
4+
"position" integer NOT NULL,
5+
"type" text NOT NULL,
6+
"content" text,
7+
"url" text,
8+
"title" text,
9+
"created_at" timestamp DEFAULT now() NOT NULL,
10+
"updated_at" timestamp DEFAULT now() NOT NULL
11+
);
12+
--> statement-breakpoint
13+
CREATE TABLE "documents" (
14+
"id" text PRIMARY KEY NOT NULL,
15+
"title" text NOT NULL,
16+
"description" text,
17+
"author_id" text,
18+
"is_published" boolean DEFAULT false NOT NULL,
19+
"created_at" timestamp DEFAULT now() NOT NULL,
20+
"updated_at" timestamp DEFAULT now() NOT NULL
21+
);
22+
--> statement-breakpoint
23+
ALTER TABLE "document_blocks" ADD CONSTRAINT "document_blocks_document_id_documents_id_fk" FOREIGN KEY ("document_id") REFERENCES "public"."documents"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
24+
ALTER TABLE "documents" ADD CONSTRAINT "documents_author_id_user_id_fk" FOREIGN KEY ("author_id") REFERENCES "public"."user"("id") ON DELETE set null ON UPDATE no action;

0 commit comments

Comments
 (0)