Skip to content

Commit

Permalink
change id to serial
Browse files Browse the repository at this point in the history
  • Loading branch information
SAMUEL BRISTOT LOLI committed Apr 2, 2022
1 parent c0fec9b commit 3f5a5a3
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/db/migration/V1__create-table-Shop.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE Shop (
id INT NOT NULL,
id SERIAL NOT NULL,
name VARCHAR(50),
address VARCHAR(200),
telephone VARCHAR(20),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE EmployeeType (
id INT NOT NULL,
id SERIAL NOT NULL,
name VARCHAR(50) NOT NULL CHECK (name in ('Manager', 'Accountant','Clerk')),
salary DECIMAL(12,2),
CONSTRAINT id_employe_pkey PRIMARY KEY (id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CREATE TABLE Employee(
id INT4 NOT NULL,
id SERIAL NOT NULL,
name VARCHAR(50),
type_id INT4 NOT NULL,
shop_id INT4 NOT NULL,
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/db/migration/V4__insert-default-values.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
INSERT INTO Shop (id, name, address, telephone) VALUES(1,'Amazon','Rua teste', '0800-038-0541');
INSERT INTO EmployeeType(id, name, salary) VALUES(1,'Manager','50000');
INSERT INTO Employee(id, name, type_id, shop_id, telephone, address, employment_date) VALUES(1,'Jhon',1,1,'+5548999181987','Rua teste 2', '1994-05-11');
INSERT INTO Shop (name, address, telephone) VALUES('Amazon','Rua teste', '0800-038-0541');
INSERT INTO EmployeeType(name, salary) VALUES('Manager','50000');
INSERT INTO Employee(name, type_id, shop_id, telephone, address, employment_date) VALUES('Jhon',1,1,'+5548999181987','Rua teste 2', '1994-05-11');

0 comments on commit 3f5a5a3

Please sign in to comment.