55
66 CREATE TABLE IF NOT EXISTS paylocity .dev .Job
77 (
8- guid uuid PRIMARY KEY ,
9- company_guid uuid NOT NULL ,
10- position_guid uuid NOT NULL ,
11- employee_guid uuid NOT NULL ,
12- FOREIGN KEY (company_guid) REFERENCES paylocity .dev .Company (guid),
13- FOREIGN KEY (position_guid) REFERENCES paylocity .dev .Position (guid),
14- FOREIGN KEY (employee_guid) REFERENCES paylocity .dev .Employee (guid),
15- UNIQUE (company_guid, employee_guid)
16- );
8+ guid uuid NOT NULL ,
9+ company_guid uuid NOT NULL ,
10+ position_guid uuid NOT NULL ,
11+ employee_guid uuid NOT NULL ,
12+ CONSTRAINT Job_PK PRIMARY KEY (guid),
13+ CONSTRAINT Job_FK_company_guid FOREIGN KEY (company_guid) REFERENCES paylocity .dev .Company (guid),
14+ CONSTRAINT Job_FK_position_guid FOREIGN KEY (position_guid) REFERENCES paylocity .dev .Position (guid),
15+ CONSTRAINT Job_FK_employee_guid FOREIGN KEY (employee_guid) REFERENCES paylocity .dev .Employee (guid),
16+ CONSTRAINT Job_unique_comp_pos_emp UNIQUE (company_guid, position_guid, employee_guid)
17+ );
18+
19+ COMMENT ON CONSTRAINT Job_unique_comp_pos_emp ON paylocity .dev .Job
20+ IS ' Prevent same person from having same job at same company' ;
0 commit comments