|
|
|
@ -59,15 +59,17 @@ CREATE TABLE IF NOT EXISTS Collaborateur( |
|
|
|
|
Name varchar(100) NOT NULL, |
|
|
|
|
FirstName varchar(100) NOT NULL, |
|
|
|
|
BirthDate date NOT NULL, |
|
|
|
|
Gender ENUM('MASCULIN','FEMININ','AUTRE') NOT NULL, |
|
|
|
|
Status ENUM('CADRE','NONCADRE','ALTERNANT','STAGIAIRE') NOT NULL, |
|
|
|
|
Gender ENUM('masculin','feminin','autre') NOT NULL DEFAULT 'masculin', |
|
|
|
|
Status ENUM('cadre','noncadre','alternant','stagiaire') NOT NULL DEFAULT 'noncadre', |
|
|
|
|
ChildrenNumber smallint NOT NULL, |
|
|
|
|
Address varchar(200) NOT NULL, |
|
|
|
|
Telephone varchar(15) NOT NULL, |
|
|
|
|
PersonalMail varchar(100) NOT NULL, |
|
|
|
|
ApsideMail varchar(100) NOT NULL, |
|
|
|
|
ResignationDate date NOT NULL, |
|
|
|
|
ReferrerId int NOT NULL, |
|
|
|
|
ResignationDate date, |
|
|
|
|
BusinessUnitId int NOT NUll, |
|
|
|
|
ReferrerId int, |
|
|
|
|
CONSTRAINT FK_COLLABORATEUR_BUSINESSUNIT FOREIGN KEY (BusinessUnitId) REFERENCES BusinessUnit(Id), |
|
|
|
|
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (ReferrerId) REFERENCES Collaborateur(Id), |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
@ -151,3 +153,9 @@ CREATE TABLE IF NOT EXISTS CollaborateurCollaboreProjet( |
|
|
|
|
CONSTRAINT FK_COLLABORATEUR_COLLABORE_PROJET FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), |
|
|
|
|
CONSTRAINT FK_PROJET_COLLABORE_COLLABORATEUR FOREIGN KEY (ProjetId) REFERENCES Projet(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
INSERT INTO Agence(Id, Name) VALUES (1,'Agence1'); |
|
|
|
|
INSERT INTO BusinessUnit(Id, Name, AgenceId) VALUES (1,'BusinessUnit1',1); |
|
|
|
|
INSERT INTO Collaborateur(Id, Name, FirstName, BirthDate, Gender, Status, ChildrenNumber, Address, Telephone, PersonalMail, |
|
|
|
|
ApsideMail, ResignationDate, BusinessUnitId, ReferrerId) |
|
|
|
|
VALUES (1,'Collab1','Collab1','2000-30-08','masculin','cadre',0,'adresse','tel','pmail','amail',NULL,1,NULL); |