diff options
Diffstat (limited to 'migrations')
-rw-r--r-- | migrations/.gitkeep | 0 | ||||
-rw-r--r-- | migrations/2020-09-22-104623_create_users/down.sql | 3 | ||||
-rw-r--r-- | migrations/2020-09-22-104623_create_users/up.sql | 8 | ||||
-rw-r--r-- | migrations/2020-11-16-133516_create_products_table/down.sql | 3 | ||||
-rw-r--r-- | migrations/2020-11-16-133516_create_products_table/up.sql | 8 | ||||
-rw-r--r-- | migrations/2020-12-13-140215_all_tables/down.sql | 11 | ||||
-rw-r--r-- | migrations/2020-12-13-140215_all_tables/up.sql | 47 |
7 files changed, 0 insertions, 80 deletions
diff --git a/migrations/.gitkeep b/migrations/.gitkeep deleted file mode 100644 index e69de29..0000000 --- a/migrations/.gitkeep +++ /dev/null | |||
diff --git a/migrations/2020-09-22-104623_create_users/down.sql b/migrations/2020-09-22-104623_create_users/down.sql deleted file mode 100644 index 2c92cb7..0000000 --- a/migrations/2020-09-22-104623_create_users/down.sql +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | -- This file should undo anything in `up.sql` | ||
2 | |||
3 | DROP TABLE members; | ||
diff --git a/migrations/2020-09-22-104623_create_users/up.sql b/migrations/2020-09-22-104623_create_users/up.sql deleted file mode 100644 index dfd27d9..0000000 --- a/migrations/2020-09-22-104623_create_users/up.sql +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | -- Your SQL goes here | ||
2 | CREATE TABLE members ( | ||
3 | id INTEGER PRIMARY KEY AUTO_INCREMENT, | ||
4 | username VARCHAR(255) NOT NULL UNIQUE, | ||
5 | password VARCHAR(255) NOT NULL, | ||
6 | phone_number VARCHAR(10) NOT NULL, | ||
7 | email_id VARCHAR(255) NOT NULL | ||
8 | ) | ||
diff --git a/migrations/2020-11-16-133516_create_products_table/down.sql b/migrations/2020-11-16-133516_create_products_table/down.sql deleted file mode 100644 index 7d99a98..0000000 --- a/migrations/2020-11-16-133516_create_products_table/down.sql +++ /dev/null | |||
@@ -1,3 +0,0 @@ | |||
1 | -- This file should undo anything in `up.sql` | ||
2 | |||
3 | DROP TABLE product; | ||
diff --git a/migrations/2020-11-16-133516_create_products_table/up.sql b/migrations/2020-11-16-133516_create_products_table/up.sql deleted file mode 100644 index 829c5be..0000000 --- a/migrations/2020-11-16-133516_create_products_table/up.sql +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | -- Your SQL goes here | ||
2 | CREATE TABLE product ( | ||
3 | id INTEGER PRIMARY KEY AUTO_INCREMENT, | ||
4 | name VARCHAR(255) NOT NULL, | ||
5 | kind VARCHAR(255), | ||
6 | price FLOAT NOT NULL, | ||
7 | description VARCHAR(255) | ||
8 | ) | ||
diff --git a/migrations/2020-12-13-140215_all_tables/down.sql b/migrations/2020-12-13-140215_all_tables/down.sql deleted file mode 100644 index 9c554a2..0000000 --- a/migrations/2020-12-13-140215_all_tables/down.sql +++ /dev/null | |||
@@ -1,11 +0,0 @@ | |||
1 | -- This file should undo anything in `up.sql` | ||
2 | |||
3 | drop table customer; | ||
4 | |||
5 | drop table product; | ||
6 | |||
7 | drop table cart_items; | ||
8 | |||
9 | drop table rating; | ||
10 | |||
11 | drop table transaction; | ||
diff --git a/migrations/2020-12-13-140215_all_tables/up.sql b/migrations/2020-12-13-140215_all_tables/up.sql deleted file mode 100644 index 527b926..0000000 --- a/migrations/2020-12-13-140215_all_tables/up.sql +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | -- Your SQL goes here | ||
2 | |||
3 | create table customer ( | ||
4 | id integer primary key auto_increment, | ||
5 | username varchar(255) not null unique, | ||
6 | password varchar(255) not null, | ||
7 | phone_number varchar(10) not null, | ||
8 | email_id varchar(255) not null, | ||
9 | address text(500) | ||
10 | ); | ||
11 | |||
12 | create table product ( | ||
13 | id integer primary key auto_increment, | ||
14 | name varchar(255) not null, | ||
15 | kind varchar(255), | ||
16 | price float not null, | ||
17 | description varchar(255) | ||
18 | ); | ||
19 | |||
20 | create table cart_items ( | ||
21 | cart_id integer, | ||
22 | product_id integer, | ||
23 | constraint cart_items_pk primary key (cart_id, product_id), | ||
24 | foreign key (cart_id) references customer(id), | ||
25 | foreign key (product_id) references product(id) | ||
26 | ); | ||
27 | |||
28 | create table rating ( | ||
29 | id integer primary key auto_increment, | ||
30 | comment_text text(500), | ||
31 | comment_date date default curdate(), | ||
32 | product_id integer, | ||
33 | customer_id integer, | ||
34 | |||
35 | stars integer check (stars >= 0 AND stars <= 5), | ||
36 | foreign key (customer_id) references customer(id), | ||
37 | foreign key (product_id) references product(id) | ||
38 | ); | ||
39 | |||
40 | create table transaction ( | ||
41 | id integer primary key auto_increment, | ||
42 | payment_type varchar(255) not null, | ||
43 | amount float not null, | ||
44 | customer_id integer, | ||
45 | |||
46 | foreign key (customer_id) references customer(id) | ||
47 | ); | ||