-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build: Set up new db-docker connection
Co-authored-by: Youssef Muhamad <[email protected]> Co-authored-by: Rogerio Junior <[email protected]>
- Loading branch information
1 parent
68b222e
commit d3baaf6
Showing
7 changed files
with
83 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
CREATE DATABASE requestLendItDB_dev | ||
WITH | ||
ENCODING = UTF8 | ||
LC_COLLATE = 'pt_BR.UTF-8' | ||
LC_CTYPE = 'pt_BR.UTF-8' | ||
TEMPLATE = template0; | ||
|
||
\c requestlenditdb_dev | ||
|
||
CREATE TABLE PRODUCT_CATEGORY ( | ||
productCategoryId SMALLSERIAL NOT NULL, | ||
name TEXT NOT NULL, | ||
|
||
CONSTRAINT PRODUCT_CATEGORY_PK PRIMARY KEY (productCategoryId) | ||
); | ||
|
||
CREATE TABLE REQUEST ( | ||
requestId UUID NOT NULL, | ||
productName TEXT NOT NULL, | ||
startDate DATE NOT NULL, | ||
endDate DATE NOT NULL, | ||
description TEXT NOT NULL, | ||
requester TEXT NOT NULL, | ||
lender TEXT NULL, | ||
productCategoryId SMALLSERIAL NOT NULL, | ||
|
||
CONSTRAINT REQUEST_PK PRIMARY KEY (requestId), | ||
|
||
CONSTRAINT REQUEST_PRODUCT_CATEGORY_FK FOREIGN KEY (productCategoryId) | ||
REFERENCES PRODUCT_CATEGORY (productCategoryId) | ||
ON DELETE RESTRICT | ||
ON UPDATE RESTRICT, | ||
|
||
CONSTRAINT VALID_REQUESTER_EMAIL CHECK (requester ~* '^[\w\-\.]+@([\w-]+\.)+[\w-]{2,4}$'), | ||
CONSTRAINT VALID_LENDER_EMAIL CHECK (lender ~* '^[\w\-\.]+@([\w-]+\.)+[\w-]{2,4}$'), | ||
CONSTRAINT VALID_LENDER_USER CHECK (requester <> lender) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
CREATE DATABASE requestLendItDB_test | ||
WITH | ||
ENCODING = UTF8 | ||
LC_COLLATE = 'pt_BR.UTF-8' | ||
LC_CTYPE = 'pt_BR.UTF-8' | ||
TEMPLATE = template0; | ||
|
||
\c requestlenditdb_test | ||
|
||
CREATE TABLE PRODUCT_CATEGORY ( | ||
productCategoryId SMALLSERIAL NOT NULL, | ||
name TEXT NOT NULL, | ||
|
||
CONSTRAINT PRODUCT_CATEGORY_PK PRIMARY KEY (productCategoryId) | ||
); | ||
|
||
CREATE TABLE REQUEST ( | ||
requestId UUID NOT NULL, | ||
productName TEXT NOT NULL, | ||
startDate DATE NOT NULL, | ||
endDate DATE NOT NULL, | ||
description TEXT NOT NULL, | ||
requester TEXT NOT NULL, | ||
lender TEXT NULL, | ||
productCategoryId SMALLSERIAL NOT NULL, | ||
|
||
CONSTRAINT REQUEST_PK PRIMARY KEY (requestId), | ||
|
||
CONSTRAINT REQUEST_PRODUCT_CATEGORY_FK FOREIGN KEY (productCategoryId) | ||
REFERENCES PRODUCT_CATEGORY (productCategoryId) | ||
ON DELETE RESTRICT | ||
ON UPDATE RESTRICT, | ||
|
||
CONSTRAINT VALID_REQUESTER_EMAIL CHECK (requester ~* '^[\w\-\.]+@([\w-]+\.)+[\w-]{2,4}$'), | ||
CONSTRAINT VALID_LENDER_EMAIL CHECK (lender ~* '^[\w\-\.]+@([\w-]+\.)+[\w-]{2,4}$'), | ||
CONSTRAINT VALID_LENDER_USER CHECK (requester <> lender) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters