Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/main/resources/db/migration/V10__insert_carts_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

INSERT INTO carts
(user_id) VALUES
(1),
(2),
(3),
(4);

11 changes: 11 additions & 0 deletions src/main/resources/db/migration/V11__create_orders_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

CREATE TABLE orders (
order_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
cart_id INT(11),
order_date TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
order_desc VARCHAR(255),
order_fee DECIMAL(7, 2),
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);

8 changes: 8 additions & 0 deletions src/main/resources/db/migration/V12__insert_orders_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

INSERT INTO orders
(cart_id, order_desc, order_fee) VALUES
(1, 'init', 5000),
(2, 'init', 5000),
(3, 'init', 5000),
(4, 'init', 5000);

10 changes: 10 additions & 0 deletions src/main/resources/db/migration/V13__create_payments_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

CREATE TABLE payments (
payment_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
order_id INT(11),
is_payed BOOLEAN,
payment_status VARCHAR(255),
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

INSERT INTO payments
(order_id, is_payed, payment_status) VALUES
(1, false, 'on_hold'),
(2, false, 'on_hold'),
(3, false, 'on_hold'),
(4, false, 'on_hold');

This file was deleted.

14 changes: 14 additions & 0 deletions src/main/resources/db/migration/V1__create_users_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@

CREATE TABLE users (
user_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
first_name VARCHAR(255),
last_name VARCHAR(255),
image_url VARCHAR(255) DEFAULT 'https://bootdey.com/img/Content/avatar/avatar7.png',
email VARCHAR(255) DEFAULT 'springxyzabcboot@gmail.com',
phone VARCHAR(255) DEFAULT '+21622125144',
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);



9 changes: 9 additions & 0 deletions src/main/resources/db/migration/V2__insert_users_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

INSERT INTO users
(first_name, last_name) VALUES
('selim', 'horri'),
('amine', 'ladjimi'),
('omar', 'derouiche'),
('admin', 'admin');


12 changes: 12 additions & 0 deletions src/main/resources/db/migration/V3__create_address_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

CREATE TABLE address (
address_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
user_id INT(11),
full_address VARCHAR(255),
postal_code VARCHAR(255),
city VARCHAR(255),
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);


11 changes: 11 additions & 0 deletions src/main/resources/db/migration/V4__insert_address_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

INSERT INTO address
(user_id, full_address, postal_code, city) VALUES
(1, 'carthage byrsa', '2016', 'carthage'),
(2, 'carthage byrsa', '2016', 'carthage'),
(3, 'carthage byrsa', '2016', 'carthage'),
(4, 'carthage byrsa', '2016', 'carthage'),
(2, 'kram', '2015', 'kram'),
(1, 'kram', '2015', 'kram');


15 changes: 15 additions & 0 deletions src/main/resources/db/migration/V5__create_credentials_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@

CREATE TABLE credentials (
credential_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
user_id INT(11),
username VARCHAR(255),
password VARCHAR(255),
role VARCHAR(255),
is_enabled BOOLEAN DEFAULT false,
is_account_non_expired BOOLEAN DEFAULT true,
is_account_non_locked BOOLEAN DEFAULT true,
is_credentials_non_expired BOOLEAN DEFAULT true,
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

INSERT INTO credentials
(user_id, username, password, role, is_enabled) VALUES
(1, 'selimhorri', '', 'ROLE_USER', true),
(2, 'amineladjimi', '', 'ROLE_USER', true),
(3, 'omarderouiche', '', 'ROLE_USER', true),
(4, 'admin', '', 'ROLE_USER', true);

Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

CREATE TABLE verification_tokens (
verification_token_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
credential_id INT(11),
verif_token VARCHAR(255),
expire_date DATE,
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

INSERT INTO verification_tokens
(credential_id, verif_token, expire_date) VALUES
(1, '', '2021-12-31'),
(2, '', '2021-12-31'),
(3, '', '2021-12-31'),
(4, '', '2021-12-31');

8 changes: 8 additions & 0 deletions src/main/resources/db/migration/V9__create_carts_table.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

CREATE TABLE carts (
cart_id INT(11) NOT NULL PRIMARY KEY AUTO_INCREMENT,
user_id INT(11),
created_at TIMESTAMP DEFAULT LOCALTIMESTAMP NOT NULL NULL_TO_DEFAULT,
updated_at TIMESTAMP
);