Skip to content

Commit

Permalink
build(migrations): add sql files to create tables
Browse files Browse the repository at this point in the history
  • Loading branch information
danvergara committed May 1, 2021
1 parent 5e38fcb commit 4f259ba
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions db/migrations/20210429225611_create_consumer.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE customers;
5 changes: 5 additions & 0 deletions db/migrations/20210429225611_create_consumer.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE customers (
id BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(36),
email VARCHAR(36)
);
1 change: 1 addition & 0 deletions db/migrations/20210429225750_create_product.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE products;
5 changes: 5 additions & 0 deletions db/migrations/20210429225750_create_product.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE products (
id BIGINT(20) UNSIGNED NOT NULL PRIMARY KEY AUTO_INCREMENT,
name VARCHAR(36),
price FLOAT
);
1 change: 1 addition & 0 deletions db/migrations/20210429225805_create_user.down.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
DROP TABLE users;
5 changes: 5 additions & 0 deletions db/migrations/20210429225805_create_user.up.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
CREATE TABLE users
(
id SERIAL PRIMARY KEY,
username VARCHAR(100) NOT NULL UNIQUE
);

0 comments on commit 4f259ba

Please sign in to comment.