-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdatabase.sql
More file actions
34 lines (27 loc) · 850 Bytes
/
Copy pathdatabase.sql
File metadata and controls
34 lines (27 loc) · 850 Bytes
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
-- Execute these queries to create the requisite tables.
-- After login, another table will be created called "session"
-- This is managed by passport.
-- Note: No seed data is currently supplied for this project.
-- Database name: StoryBoard
CREATE TABLE "user" (
"id" SERIAL PRIMARY KEY,
"username" VARCHAR (80) UNIQUE NOT NULL,
"password" VARCHAR (1000) NOT NULL
);
CREATE TABLE "projects" (
"id" SERIAL PRIMARY KEY,
"project_name" VARCHAR (100),
"user_id" INTEGER REFERENCES "user" ON DELETE CASCADE
);
CREATE TABLE "added_cards" (
"id" SERIAL PRIMARY KEY,
"project_id" INTEGER REFERENCES "projects" ON DELETE CASCADE,
"x" INTEGER DEFAULT 1,
"y" INTEGER DEFAULT 1,
"w" INTEGER DEFAULT 3,
"h" INTEGER DEFAULT 1,
"bg_color" VARCHAR(50),
"card_type" VARCHAR(200),
"card_settings" JSONB,
"card_header" VARCHAR(500)
);