creationDtoSql #1
Merged
AlexandreRuiz
merged 7 commits from creationDtoSql
into develop
3 years ago
@ -1,7 +0,0 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net5.0</TargetFramework> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
@ -1,161 +0,0 @@ |
||||
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( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
nom varchar(100) NOT NULL UNIQUE, |
||||
adresse_id int NOT NULL, |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS business_unit; |
||||
CREATE TABLE IF NOT EXISTS business_unit( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
nom varchar(100) NOT NULL UNIQUE, |
||||
agence_id int NOT NULL, |
||||
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (agence_id) references agence(id), |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS site; |
||||
CREATE TABLE IF NOT EXISTS site( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
nom varchar(100) NOT NULL UNIQUE, |
||||
adresse varchar(200) NOT NULL, |
||||
business_unit_id int NOT NULL, |
||||
CONSTRAINT FK_SITE_BUSINESS_UNIT FOREIGN KEY (business_unit_id) references business_unit(id), |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS projet; |
||||
CREATE TABLE IF NOT EXISTS projet( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
nom varchar(100) NOT NULL UNIQUE, |
||||
client varchar(100) NOT NULL, |
||||
description varchar(100) NOT NULL, |
||||
date_debut date NOT NULL, |
||||
dateFin date NOT NULL, |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS technologie; |
||||
CREATE TABLE IF NOT EXISTS technologie( |
||||
id int NOT NULL UNIQUE, |
||||
intitule varchar(100) NOT NULL UNIQUE, |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS periode_essai; |
||||
CREATE TABLE IF NOT EXISTS periode_essai( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
date_debut date NOT NULL, |
||||
date_fin_prevue date NOT NULL, |
||||
date_fin_effective date NOT NULL, |
||||
commentaire varchar(100), |
||||
issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE'), |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
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( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
nom varchar(100) NOT NULL UNIQUE, |
||||
prenom varchar(100) NOT NULL, |
||||
date_naissance date NOT NULL, |
||||
genre ENUM('MASCULIN','FEMININ','AUTRE'), |
||||
statut ENUM('CADRE','NON-CADRE','ALTERNANT','STAGIAIRE'), |
||||
nombre_enfants smallint, |
||||
telephone varchar(15), |
||||
mail_personnel varchar(100), |
||||
mail_apside varchar(100), |
||||
date_depart date, |
||||
parrain_id int, |
||||
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (parrain_id) REFERENCES collaborateur(id), |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS referencement; |
||||
CREATE TABLE IF NOT EXISTS referencement( |
||||
id int NOT NULL AUTO_INCREMENT, |
||||
date_debut date NOT NULL, |
||||
date_fin date NOT NULL, |
||||
refere_id int NOT NULL, |
||||
referent_id int NOT NULL, |
||||
CONSTRAINT FK_COLLABORATEUR_REFERE FOREIGN KEY (refere_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_COLLABORATEUR_REFERENT FOREIGN KEY (referent_id) REFERENCES collaborateur(id), |
||||
PRIMARY KEY (id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS collaborateur_est_fonction; |
||||
CREATE TABLE IF NOT EXISTS collaborateur_est_fonction( |
||||
collaborateur_id int NOT NULL, |
||||
fonction_id int NOT NULL, |
||||
PRIMARY KEY (collaborateur_id,fonction_id), |
||||
CONSTRAINT FK_COLLABORATEUR_FONCTION FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_FONCTION_COLLABORATEUR FOREIGN KEY (fonction_id) REFERENCES fonction(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS collaborateur_appartient_business_unit; |
||||
CREATE TABLE IF NOT EXISTS collaborateur_appartient_business_unit( |
||||
collaborateur_id int NOT NULL, |
||||
business_unit_id int NOT NULL, |
||||
PRIMARY KEY (collaborateur_id,business_unit_id), |
||||
CONSTRAINT FK_COLLABORATEUR_BUSINESS_UNIT FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_BUSINESS_UNIT_COLLABORATEUR FOREIGN KEY (business_unit_id) REFERENCES business_unit(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS collaborateur_effectue_periode_essai; |
||||
CREATE TABLE IF NOT EXISTS collaborateur_effectue_periode_essai( |
||||
collaborateur_id int NOT NULL, |
||||
periode_essai_id int NOT NULL, |
||||
PRIMARY KEY (collaborateur_id,periode_essai_id), |
||||
CONSTRAINT FK_COLLABORATEUR_PERIODE_ESSAI FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_PERIODE_ESSAI_COLLABORATEUR FOREIGN KEY (periode_essai_id) REFERENCES periode_essai(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS site_developpe_projet; |
||||
CREATE TABLE IF NOT EXISTS site_developpe_projet( |
||||
site_id int NOT NULL, |
||||
projet_id int NOT NULL, |
||||
PRIMARY KEY (site_id,projet_id), |
||||
CONSTRAINT FK_SITE_PROJET FOREIGN KEY (site_id) REFERENCES site(id), |
||||
CONSTRAINT FK_PROJET_SITE FOREIGN KEY (projet_id) REFERENCES projet(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS projet_utilise_technologie; |
||||
CREATE TABLE IF NOT EXISTS projet_utilise_technologie( |
||||
projet_id int NOT NULL, |
||||
technologie_id int NOT NULL, |
||||
PRIMARY KEY (projet_id,technologie_id), |
||||
CONSTRAINT FK_PROJET_TECHNOLOGIE FOREIGN KEY (projet_id) REFERENCES projet(id), |
||||
CONSTRAINT FK_TECHNOLOGIE_PROJET FOREIGN KEY (technologie_id) REFERENCES technologie(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS collaborateur_manage_projet; |
||||
CREATE TABLE IF NOT EXISTS collaborateur_manage_projet( |
||||
collaborateur_id int NOT NULL, |
||||
projet_id int NOT NULL, |
||||
PRIMARY KEY (collaborateur_id,projet_id), |
||||
CONSTRAINT FK_COLLABORATEUR_MANAGE_PROJET FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_PROJET_MANAGE_COLLABORATEUR FOREIGN KEY (projet_id) REFERENCES projet(id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS collaborateur_collabore_projet; |
||||
CREATE TABLE IF NOT EXISTS collaborateur_collabore_projet( |
||||
collaborateur_id int NOT NULL, |
||||
projet_id int NOT NULL, |
||||
PRIMARY KEY (collaborateur_id,projet_id), |
||||
CONSTRAINT FK_COLLABORATEUR_COLLABORE_PROJET FOREIGN KEY (collaborateur_id) REFERENCES collaborateur(id), |
||||
CONSTRAINT FK_PROJET_COLLABORE_COLLABORATEUR FOREIGN KEY (projet_id) REFERENCES projet(id) |
||||
); |
@ -0,0 +1,25 @@ |
||||
var builder = WebApplication.CreateBuilder(args); |
||||
|
||||
// Add services to the container. |
||||
|
||||
builder.Services.AddControllers(); |
||||
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle |
||||
builder.Services.AddEndpointsApiExplorer(); |
||||
builder.Services.AddSwaggerGen(); |
||||
|
||||
var app = builder.Build(); |
||||
|
||||
// Configure the HTTP request pipeline. |
||||
if (app.Environment.IsDevelopment()) |
||||
{ |
||||
app.UseSwagger(); |
||||
app.UseSwaggerUI(); |
||||
} |
||||
|
||||
app.UseHttpsRedirection(); |
||||
|
||||
app.UseAuthorization(); |
||||
|
||||
app.MapControllers(); |
||||
|
||||
app.Run(); |
@ -0,0 +1,9 @@ |
||||
{ |
||||
"Logging": { |
||||
"LogLevel": { |
||||
"Default": "Information", |
||||
"Microsoft.AspNetCore": "Warning" |
||||
} |
||||
}, |
||||
"AllowedHosts": "*" |
||||
} |
@ -0,0 +1,17 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk.Web"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<Nullable>enable</Nullable> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
</PropertyGroup> |
||||
|
||||
<ItemGroup> |
||||
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" /> |
||||
</ItemGroup> |
||||
|
||||
<ItemGroup> |
||||
<Folder Include="Controllers\" /> |
||||
</ItemGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,9 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,9 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,9 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
@ -0,0 +1,153 @@ |
||||
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( |
||||
Id int NOT NULL AUTO_INCREMENT, |
||||
Name varchar(100) NOT NULL UNIQUE, |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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, |
||||
CONSTRAINT FK_BUSINESS_UNIT_AGENCE FOREIGN KEY (AgenceId) references Agence(Id), |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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, |
||||
BusinessUnitId int NOT NULL, |
||||
CONSTRAINT FK_SITE_BUSINESS_UNIT FOREIGN KEY (BusinessUnitId) references BusinessUnit(Id), |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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, |
||||
Description varchar(100) NOT NULL, |
||||
StartingDate date NOT NULL, |
||||
EndingDate date NOT NULL, |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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) |
||||
); |
||||
|
||||
|
||||
|
||||
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, |
||||
RealEndingDate date NOT NULL, |
||||
Comment varchar(100) NOT NULL, |
||||
Issue ENUM('VALIDEE','PROLONGEE_COLLAB','PROLONGEE_APSIDE','ARRETEE_COLLAB','ARRETEE_APSIDE') NOT NULL, |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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( |
||||
Id int NOT NULL AUTO_INCREMENT, |
||||
Name varchar(100) NOT NULL UNIQUE, |
||||
FirstName varchar(100) NOT NULL, |
||||
BirthDate date NOT NULL, |
||||
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, |
||||
ResignationDate date NOT NULL, |
||||
ReferrerId int NOT NULL, |
||||
CONSTRAINT FK_COLLABORATEUR_PARRAIN FOREIGN KEY (ReferrerId) REFERENCES Collaborateur(Id), |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
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, |
||||
ReferredId int NOT NULL, |
||||
ReferrerId int NOT NULL, |
||||
CONSTRAINT FK_COLLABORATEUR_REFERE FOREIGN KEY (ReferredId) REFERENCES Collaborateur(Id), |
||||
CONSTRAINT FK_COLLABORATEUR_REFERENT FOREIGN KEY (ReferrerId) REFERENCES Collaborateur(Id), |
||||
PRIMARY KEY (Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS CollaborateurEstFonction; |
||||
CREATE TABLE IF NOT EXISTS CollaborateurEstFonction( |
||||
CollaborateurId int NOT NULL, |
||||
FonctionId int NOT NULL, |
||||
PRIMARY KEY (CollaborateurId,FonctionId), |
||||
CONSTRAINT FK_COLLABORATEUR_FONCTION FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), |
||||
CONSTRAINT FK_FONCTION_COLLABORATEUR FOREIGN KEY (FonctionId) REFERENCES Fonction(Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS CollaborateurAppartientBusinessUnit; |
||||
CREATE TABLE IF NOT EXISTS CollaborateurAppartientBusinessUnit( |
||||
CollaborateurId int NOT NULL, |
||||
BusinessUnitId int NOT NULL, |
||||
PRIMARY KEY (CollaborateurId,BusinessUnitId), |
||||
CONSTRAINT FK_COLLABORATEUR_BUSINESS_UNIT FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), |
||||
CONSTRAINT FK_BUSINESS_UNIT_COLLABORATEUR FOREIGN KEY (BusinessUnitId) REFERENCES BusinessUnit(Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS CollaborateurEffectuePeriodeEssai; |
||||
CREATE TABLE IF NOT EXISTS CollaborateurEffectuePeriodeEssai( |
||||
CollaborateurId int NOT NULL, |
||||
PeriodeEssaiId int NOT NULL, |
||||
PRIMARY KEY (CollaborateurId,PeriodeEssaiId), |
||||
CONSTRAINT FK_COLLABORATEUR_PERIODE_ESSAI FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), |
||||
CONSTRAINT FK_PERIODE_ESSAI_COLLABORATEUR FOREIGN KEY (PeriodeEssaiId) REFERENCES PeriodeEssai(Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS SiteDeveloppeProjet; |
||||
CREATE TABLE IF NOT EXISTS SiteDeveloppeProjet( |
||||
SiteId int NOT NULL, |
||||
ProjetId int NOT NULL, |
||||
PRIMARY KEY (SiteId,ProjetId), |
||||
CONSTRAINT FK_SITE_PROJET FOREIGN KEY (SiteId) REFERENCES Site(Id), |
||||
CONSTRAINT FK_PROJET_SITE FOREIGN KEY (ProjetId) REFERENCES Projet(Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS ProjetUtiliseTechnologie; |
||||
CREATE TABLE IF NOT EXISTS ProjetUtiliseTechnologie( |
||||
ProjetId int NOT NULL, |
||||
TechnologieId int NOT NULL, |
||||
PRIMARY KEY (ProjetId,TechnologieId), |
||||
CONSTRAINT FK_PROJET_TECHNOLOGIE FOREIGN KEY (ProjetId) REFERENCES Projet(Id), |
||||
CONSTRAINT FK_TECHNOLOGIE_PROJET FOREIGN KEY (TechnologieId) REFERENCES Technologie(Id) |
||||
); |
||||
|
||||
DROP TABLE IF EXISTS CollaborateurCollaboreProjet; |
||||
CREATE TABLE IF NOT EXISTS CollaborateurCollaboreProjet( |
||||
CollaborateurId int NOT NULL, |
||||
ProjetId int NOT NULL, |
||||
isManager boolean NOT NULL, |
||||
PRIMARY KEY (CollaborateurId,ProjetId), |
||||
CONSTRAINT FK_COLLABORATEUR_COLLABORE_PROJET FOREIGN KEY (CollaborateurId) REFERENCES Collaborateur(Id), |
||||
CONSTRAINT FK_PROJET_COLLABORE_COLLABORATEUR FOREIGN KEY (ProjetId) REFERENCES Projet(Id) |
||||
); |
@ -0,0 +1,9 @@ |
||||
<Project Sdk="Microsoft.NET.Sdk"> |
||||
|
||||
<PropertyGroup> |
||||
<TargetFramework>net6.0</TargetFramework> |
||||
<ImplicitUsings>enable</ImplicitUsings> |
||||
<Nullable>enable</Nullable> |
||||
</PropertyGroup> |
||||
|
||||
</Project> |
Loading…
Reference in new issue