|
|
|
@ -2,15 +2,15 @@ DROP DATABASE IF EXISTS collaborateur_epa; |
|
|
|
|
CREATE DATABASE IF NOT EXISTS collaborateur_epa /*!40100 DEFAULT CHARACTER SET latin1 */; |
|
|
|
|
USE collaborateur_epa; |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS agence; |
|
|
|
|
CREATE TABLE IF NOT EXISTS agence( |
|
|
|
|
DROP TABLE IF EXISTS Agence; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Agence( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS business_unit; |
|
|
|
|
CREATE TABLE IF NOT EXISTS business_unit( |
|
|
|
|
DROP TABLE IF EXISTS BusinessUnit; |
|
|
|
|
CREATE TABLE IF NOT EXISTS BusinessUnit( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
AgenceId int NOT NULL, |
|
|
|
@ -18,8 +18,8 @@ CREATE TABLE IF NOT EXISTS business_unit( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS site; |
|
|
|
|
CREATE TABLE IF NOT EXISTS site( |
|
|
|
|
DROP TABLE IF EXISTS Site; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Site( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
Address varchar(200) NOT NULL, |
|
|
|
@ -28,8 +28,8 @@ CREATE TABLE IF NOT EXISTS site( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS projet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS projet( |
|
|
|
|
DROP TABLE IF EXISTS Projet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Projet( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
Client varchar(100) NOT NULL, |
|
|
|
@ -39,8 +39,8 @@ CREATE TABLE IF NOT EXISTS projet( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS technologie; |
|
|
|
|
CREATE TABLE IF NOT EXISTS technologie( |
|
|
|
|
DROP TABLE IF EXISTS Technologie; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Technologie( |
|
|
|
|
Id int NOT NULL UNIQUE, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
@ -48,8 +48,8 @@ CREATE TABLE IF NOT EXISTS technologie( |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS periode_essai; |
|
|
|
|
CREATE TABLE IF NOT EXISTS periode_essai( |
|
|
|
|
DROP TABLE IF EXISTS PeriodeEssai; |
|
|
|
|
CREATE TABLE IF NOT EXISTS PeriodeEssai( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
StartingDate date NOT NULL, |
|
|
|
|
PlannedEndingDate date NOT NULL, |
|
|
|
@ -59,15 +59,15 @@ CREATE TABLE IF NOT EXISTS periode_essai( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS fonction; |
|
|
|
|
CREATE TABLE IF NOT EXISTS fonction( |
|
|
|
|
DROP TABLE IF EXISTS Fonction; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Fonction( |
|
|
|
|
Id int NOT NULL UNIQUE, |
|
|
|
|
intitule varchar(100) NOT NULL UNIQUE, |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur( |
|
|
|
|
DROP TABLE IF EXISTS Collaborateur; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Collaborateur( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
Name varchar(100) NOT NULL UNIQUE, |
|
|
|
|
FirstName varchar(100) NOT NULL, |
|
|
|
@ -75,6 +75,7 @@ CREATE TABLE IF NOT EXISTS collaborateur( |
|
|
|
|
Gender ENUM('MASCULIN','FEMININ','AUTRE') NOT NULL, |
|
|
|
|
Status ENUM('CADRE','NONCADRE','ALTERNANT','STAGIAIRE') NOT NULL, |
|
|
|
|
ChildrenNumber smallint NOT NULL, |
|
|
|
|
Address varchar(200) NOT NULL, |
|
|
|
|
Telephone varchar(15) NOT NULL, |
|
|
|
|
PersonalMail varchar(100) NOT NULL, |
|
|
|
|
ApsideMail varchar(100) NOT NULL, |
|
|
|
@ -84,8 +85,8 @@ CREATE TABLE IF NOT EXISTS collaborateur( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS referencement; |
|
|
|
|
CREATE TABLE IF NOT EXISTS referencement( |
|
|
|
|
DROP TABLE IF EXISTS Referencement; |
|
|
|
|
CREATE TABLE IF NOT EXISTS Referencement( |
|
|
|
|
Id int NOT NULL AUTO_INCREMENT, |
|
|
|
|
StartingDate date NOT NULL, |
|
|
|
|
EndingDate date NOT NULL, |
|
|
|
@ -96,8 +97,8 @@ CREATE TABLE IF NOT EXISTS referencement( |
|
|
|
|
PRIMARY KEY (Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur_est_fonction; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur_est_fonction( |
|
|
|
|
DROP TABLE IF EXISTS CollaborateurEstFonction; |
|
|
|
|
CREATE TABLE IF NOT EXISTS CollaborateurEstFonction( |
|
|
|
|
CollaborateurId int NOT NULL, |
|
|
|
|
FonctionId int NOT NULL, |
|
|
|
|
PRIMARY KEY (CollaborateurId,FonctionId), |
|
|
|
@ -105,8 +106,8 @@ CREATE TABLE IF NOT EXISTS collaborateur_est_fonction( |
|
|
|
|
CONSTRAINT FK_FONCTION_COLLABORATEUR FOREIGN KEY (FonctionId) REFERENCES fonction(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur_appartient_business_unit; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur_appartient_business_unit( |
|
|
|
|
DROP TABLE IF EXISTS CollaborateurAppartientBusinessUnit; |
|
|
|
|
CREATE TABLE IF NOT EXISTS CollaborateurAppartientBusinessUnit( |
|
|
|
|
CollaborateurId int NOT NULL, |
|
|
|
|
BusinessUnitId int NOT NULL, |
|
|
|
|
PRIMARY KEY (CollaborateurId,BusinessUnitId), |
|
|
|
@ -114,8 +115,8 @@ CREATE TABLE IF NOT EXISTS collaborateur_appartient_business_unit( |
|
|
|
|
CONSTRAINT FK_BUSINESS_UNIT_COLLABORATEUR FOREIGN KEY (BusinessUnitId) REFERENCES business_unit(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur_effectue_periode_essai; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur_effectue_periode_essai( |
|
|
|
|
DROP TABLE IF EXISTS CollaborateurEffectuePeriodeEssai; |
|
|
|
|
CREATE TABLE IF NOT EXISTS CollaborateurEffectuePeriodeEssai( |
|
|
|
|
CollaborateurId int NOT NULL, |
|
|
|
|
PeriodeEssaiId int NOT NULL, |
|
|
|
|
PRIMARY KEY (CollaborateurId,PeriodeEssaiId), |
|
|
|
@ -123,8 +124,8 @@ CREATE TABLE IF NOT EXISTS collaborateur_effectue_periode_essai( |
|
|
|
|
CONSTRAINT FK_PERIODE_ESSAI_COLLABORATEUR FOREIGN KEY (PeriodeEssaiId) REFERENCES periode_essai(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS site_developpe_projet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS site_developpe_projet( |
|
|
|
|
DROP TABLE IF EXISTS SiteDeveloppeProjet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS SiteDeveloppeProjet( |
|
|
|
|
SiteId int NOT NULL, |
|
|
|
|
ProjetId int NOT NULL, |
|
|
|
|
PRIMARY KEY (SiteId,ProjetId), |
|
|
|
@ -132,8 +133,8 @@ CREATE TABLE IF NOT EXISTS site_developpe_projet( |
|
|
|
|
CONSTRAINT FK_PROJET_SITE FOREIGN KEY (ProjetId) REFERENCES projet(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS projet_utilise_technologie; |
|
|
|
|
CREATE TABLE IF NOT EXISTS projet_utilise_technologie( |
|
|
|
|
DROP TABLE IF EXISTS ProjetUtiliseTechnologie; |
|
|
|
|
CREATE TABLE IF NOT EXISTS ProjetUtiliseTechnologie( |
|
|
|
|
ProjetId int NOT NULL, |
|
|
|
|
TechnologieId int NOT NULL, |
|
|
|
|
PRIMARY KEY (ProjetId,TechnologieId), |
|
|
|
@ -141,8 +142,8 @@ CREATE TABLE IF NOT EXISTS projet_utilise_technologie( |
|
|
|
|
CONSTRAINT FK_TECHNOLOGIE_PROJET FOREIGN KEY (TechnologieId) REFERENCES technologie(Id) |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
DROP TABLE IF EXISTS collaborateur_collabore_projet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS collaborateur_collabore_projet( |
|
|
|
|
DROP TABLE IF EXISTS CollaborateurCollaboreProjet; |
|
|
|
|
CREATE TABLE IF NOT EXISTS CollaborateurCollaboreProjet( |
|
|
|
|
CollaborateurId int NOT NULL, |
|
|
|
|
ProjetId int NOT NULL, |
|
|
|
|
isManager boolean NOT NULL, |
|
|
|
|