-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathschema.sql
59 lines (55 loc) · 1.59 KB
/
schema.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
DROP TABLE IF EXISTS User;
CREATE TABLE "User" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME,
"password" TEXT NOT NULL,
"email" TEXT NOT NULL,
"name" TEXT
);
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
DROP TABLE IF EXISTS Task;
CREATE TABLE "Task" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME,
"title" TEXT,
"content" TEXT,
"userId" INTEGER
);
DROP TABLE IF EXISTS "Session";
CREATE TABLE "Session" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"sessionId" TEXT NOT NULL,
"key" TEXT NOT NULL,
"value" TEXT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME
);
DROP TABLE IF EXISTS "Category";
CREATE TABLE "Category" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME,
"name" TEXT NOT NULL,
"userId" INTEGER
);
DROP TABLE IF EXISTS "Post";
CREATE TABLE "Post" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME,
"title" TEXT,
"content" TEXT,
"categoryId" INTEGER,
"userId" INTEGER
);
DROP TABLE IF EXISTS "Page";
CREATE TABLE "Page" (
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updatedAt" DATETIME,
"title" TEXT,
"content" TEXT,
"userId" INTEGER
);