-
Notifications
You must be signed in to change notification settings - Fork 0
/
schema.sql
39 lines (34 loc) · 1.11 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
-- CREATE SCHEMA `fashionista` ;
-- Todo: Check if the foreign key connections are working.
CREATE table if not exists `cloths` ;
id int auto_increment,
name varchar(255) not null default '',
type varchar (255) not null,
color varchar(255) default '',
pattern varchar(255) default '' ,
material varchar(255) default '',
size int default 0,
primary key (id)
);
create table if not exists Looks(
lookId int auto_increment,
lookName varchar(255) not null,
clothes int references Cloths(id),
primary key (lookId)
);
create table if not exists Collections(
collectionId int auto_increment,
collectionName varchar(255) not null,
look int references Looks(lookId),
primary key(collectionId)
);
create table if not exists Users(
id int auto_increment,
email varchar(255) not null,
password varchar(255) not null,
description varchar (255) default '',
status enum("inactive","active") not null default 'inactive',
cloths int references Cloths(id),
collection int references Collections(collectionId),
primary key(id)
);