Merge pull request 'dockerisation' (#9) from dockerisation into develop

Reviewed-on: Clement.Ferrere/Collaborateur_Epa_Back#9
pull/10/head
Clement.Ferrere 3 years ago
commit c71ed26a24
  1. 25
      Collaborateur_Epa_Back/.dockerignore
  2. 6
      Collaborateur_Epa_Back/.env
  3. 19
      Collaborateur_Epa_Back/docker-compose.dcproj
  4. 11
      Collaborateur_Epa_Back/docker-compose.override.yml
  5. 37
      Collaborateur_Epa_Back/docker-compose.yml
  6. 29
      Collaborateur_Epa_Back/espacecollab.backend.api/Dockerfile
  7. 17
      Collaborateur_Epa_Back/espacecollab.backend.api/Properties/launchSettings.json
  8. 3
      Collaborateur_Epa_Back/espacecollab.backend.api/appsettings.json
  9. 4
      Collaborateur_Epa_Back/espacecollab.backend.api/espacecollab.backend.api.csproj
  10. 13
      Collaborateur_Epa_Back/espacecollab.backend.sln
  11. 285
      Collaborateur_Epa_Back/init_db.sql

@ -0,0 +1,25 @@
**/.classpath
**/.dockerignore
**/.env
**/.git
**/.gitignore
**/.project
**/.settings
**/.toolstarget
**/.vs
**/.vscode
**/*.*proj.user
**/*.dbmdl
**/*.jfm
**/azds.yaml
**/bin
**/charts
**/docker-compose*
**/Dockerfile*
**/node_modules
**/npm-debug.log
**/obj
**/secrets.dev.yaml
**/values.dev.yaml
LICENSE
README.md

@ -0,0 +1,6 @@
DATABASE_HOSTNAME=localhost
DATABASE_PORT=3306
DATABASE_NAME=collaborateur_epa
APP_DB_USERNAME=root
APP_DB_PASSWORD=root
APP_DB_ROOT_PASSWORD=root

@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
<PropertyGroup Label="Globals">
<ProjectVersion>2.1</ProjectVersion>
<DockerTargetOS>Linux</DockerTargetOS>
<ProjectGuid>815b6abd-7550-4d79-a53b-e84f4d4a7475</ProjectGuid>
<DockerLaunchAction>LaunchBrowser</DockerLaunchAction>
<DockerServiceUrl>{Scheme}://localhost:{ServicePort}/swagger</DockerServiceUrl>
<DockerServiceName>espacecollab.backend.api</DockerServiceName>
</PropertyGroup>
<ItemGroup>
<None Include="docker-compose.override.yml">
<DependentUpon>docker-compose.yml</DependentUpon>
</None>
<None Include="docker-compose.yml" />
<None Include=".dockerignore" />
<None Include=".env" />
</ItemGroup>
</Project>

@ -0,0 +1,11 @@
version: '3.4'
services:
espacecollab.backend.api:
environment:
- ASPNETCORE_ENVIRONMENT=Development
- ASPNETCORE_URLS=https://+:443;http://+:80
- ASPNETCORE_Kestrel__Certificates__Default__Password=password
- ASPNETCORE_Kestrel__Certificates__Default__Path=/https/aspnetapp.pfx
volumes:
- ~/.aspnet/https:/https:ro

@ -0,0 +1,37 @@
version: '3.4'
volumes:
data-volume: {}
services:
db:
image: "mariadb:10.7.1"
restart: always
environment:
- MYSQL_DATABASE=${DATABASE_NAME}
- MYSQL_USERNAME=${APP_DB_USERNAME}
- MYSQL_PASSWORD=${APP_DB_PASSWORD}
- MYSQL_ROOT_PASSWORD=${APP_DB_ROOT_PASSWORD}
volumes:
- data-volume:/var/lib/mysql
- ./init_db.sql:/docker-entrypoint-initdb.d/init.sql
espacecollab.backend.api:
image: ${DOCKER_REGISTRY-}espacecollabbackendapi
build:
context: .
dockerfile: espacecollab.backend.api/Dockerfile
ports:
- "5000:80"
- "5001:443"
links:
- db
environment:
- DATABASE_HOSTNAME=db
- DATABASE_PORT=3306
- DATABASE_NAME=${DATABASE_NAME}
- DATABASE_USERNAME=${APP_DB_USERNAME}
- DATABASE_PASSWORD=${APP_DB_PASSWORD}

@ -0,0 +1,29 @@
#See https://aka.ms/containerfastmode to understand how Visual Studio uses this Dockerfile to build your images for faster debugging.
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443
FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["espacecollab.backend.api/espacecollab.backend.api.csproj", "espacecollab.backend.api/"]
COPY ["espacecollab.backend.appservices/espacecollab.backend.appservices.csproj", "espacecollab.backend.appservices/"]
COPY ["espacecollab.backend.appservices.dtos/espacecollab.backend.appservices.dtos.csproj", "espacecollab.backend.appservices.dtos/"]
COPY ["espacecollab.backend.infrastructure.sql.dtos/espacecollab.backend.infrastructure.sql.dtos.csproj", "espacecollab.backend.infrastructure.sql.dtos/"]
COPY ["espacecollab.backend.appservices.interfaces/espacecollab.backend.appservices.interfaces.csproj", "espacecollab.backend.appservices.interfaces/"]
COPY ["espacecollab.backend.infrastructure.sql/espacecollab.backend.infrastructure.sql.csproj", "espacecollab.backend.infrastructure.sql/"]
COPY ["espacecollab.backend.infrastructure.interfaces/espacecollab.backend.infrastructure.interfaces.csproj", "espacecollab.backend.infrastructure.interfaces/"]
COPY ["espacecollab.backend.infrastructure.fake/espacecollab.backend.infrastructure.fake.csproj", "espacecollab.backend.infrastructure.fake/"]
RUN dotnet restore "espacecollab.backend.api/espacecollab.backend.api.csproj"
COPY . .
WORKDIR "/src/espacecollab.backend.api"
RUN dotnet build "espacecollab.backend.api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "espacecollab.backend.api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "espacecollab.backend.api.dll"]

@ -1,4 +1,4 @@
{
{
"$schema": "https://json.schemastore.org/launchsettings.json",
"iisSettings": {
"windowsAuthentication": false,
@ -11,13 +11,13 @@
"profiles": {
"espacecollab.backend.api": {
"commandName": "Project",
"dotnetRunMessages": true,
"launchBrowser": true,
"launchUrl": "swagger",
"applicationUrl": "https://localhost:7125;http://localhost:5125",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"applicationUrl": "https://localhost:8081;http://localhost:8080",
"dotnetRunMessages": true
},
"IIS Express": {
"commandName": "IISExpress",
@ -26,6 +26,13 @@
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
}
},
"Docker": {
"commandName": "Docker",
"launchBrowser": true,
"launchUrl": "{Scheme}://{ServiceHost}:{ServicePort}/swagger",
"publishAllPorts": true,
"useSSL": true
}
}
}
}

@ -8,6 +8,7 @@
"AllowedHosts": "*",
"Sql": {
"LoadFake": false,
"ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa"
"ConnectionString": "server=db;user=root;password=root;database=collaborateur_epa"
//"ConnectionString": "server=localhost;user=root;password=root;database=collaborateur_epa"
}
}

@ -4,10 +4,14 @@
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
<UserSecretsId>5a7cf5e2-2bf7-4dae-aea9-2522da3cf955</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Cors" Version="2.2.0" />
<PackageReference Include="Microsoft.VisualStudio.Azure.Containers.Tools.Targets" Version="1.14.0" />
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.2.3" />
</ItemGroup>

@ -25,7 +25,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.infras
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.appservices.interfaces", "espacecollab.backend.appservices.interfaces\espacecollab.backend.appservices.interfaces.csproj", "{7872657E-46E2-44A1-AFA6-0D3B9E45084A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "espacecollab.backend.api.tests", "espacecollab.backend.api.tests\espacecollab.backend.api.tests.csproj", "{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "espacecollab.backend.api.tests", "espacecollab.backend.api.tests\espacecollab.backend.api.tests.csproj", "{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}"
EndProject
Project("{E53339B2-1760-4266-BCC7-CA923CBCF16C}") = "docker-compose", "docker-compose.dcproj", "{815B6ABD-7550-4D79-A53B-E84F4D4A7475}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "9 Database", "9 Database", "{4C74D622-BEC1-41C9-95F1-7C44375B531B}"
ProjectSection(SolutionItems) = preProject
init_db.sql = init_db.sql
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -69,6 +76,10 @@ Global
{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5EA7CAB6-B7A8-4A54-8A1D-774A376974CB}.Release|Any CPU.Build.0 = Release|Any CPU
{815B6ABD-7550-4D79-A53B-E84F4D4A7475}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{815B6ABD-7550-4D79-A53B-E84F4D4A7475}.Debug|Any CPU.Build.0 = Debug|Any CPU
{815B6ABD-7550-4D79-A53B-E84F4D4A7475}.Release|Any CPU.ActiveCfg = Release|Any CPU
{815B6ABD-7550-4D79-A53B-E84F4D4A7475}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -0,0 +1,285 @@
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
CREATE SCHEMA IF NOT EXISTS `collaborateur_epa` DEFAULT CHARACTER SET latin1 ;
USE `collaborateur_epa` ;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`agence`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`agence` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE)
ENGINE = InnoDB
AUTO_INCREMENT = 5
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`businessunit`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`businessunit` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
`AgenceId` INT NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE,
INDEX `FK_BUSINESS_UNIT_AGENCE` (`AgenceId` ASC) VISIBLE,
CONSTRAINT `FK_BUSINESS_UNIT_AGENCE`
FOREIGN KEY (`AgenceId`)
REFERENCES `collaborateur_epa`.`agence` (`Id`))
ENGINE = InnoDB
AUTO_INCREMENT = 2
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`collaborateur`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateur` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
`FirstName` VARCHAR(100) NOT NULL,
`BirthDate` DATE 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 NULL DEFAULT NULL,
`BusinessUnitId` INT NOT NULL,
`ReferrerId` INT NULL DEFAULT NULL,
PRIMARY KEY (`Id`),
INDEX `FK_COLLABORATEUR_BUSINESSUNIT` (`BusinessUnitId` ASC) VISIBLE,
INDEX `FK_COLLABORATEUR_PARRAIN` (`ReferrerId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_BUSINESSUNIT`
FOREIGN KEY (`BusinessUnitId`)
REFERENCES `collaborateur_epa`.`businessunit` (`Id`),
CONSTRAINT `FK_COLLABORATEUR_PARRAIN`
FOREIGN KEY (`ReferrerId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`))
ENGINE = InnoDB
AUTO_INCREMENT = 13
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`collaborateurappartientbusinessunit`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurappartientbusinessunit` (
`CollaborateurId` INT NOT NULL,
`BusinessUnitId` INT NOT NULL,
PRIMARY KEY (`CollaborateurId`, `BusinessUnitId`),
INDEX `FK_BUSINESS_UNIT_COLLABORATEUR` (`BusinessUnitId` ASC) VISIBLE,
CONSTRAINT `FK_BUSINESS_UNIT_COLLABORATEUR`
FOREIGN KEY (`BusinessUnitId`)
REFERENCES `collaborateur_epa`.`businessunit` (`Id`),
CONSTRAINT `FK_COLLABORATEUR_BUSINESS_UNIT`
FOREIGN KEY (`CollaborateurId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`projet`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`projet` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
`Client` VARCHAR(100) NOT NULL,
`Description` VARCHAR(100) NOT NULL,
`StartingDate` DATE NOT NULL,
`EndingDate` DATE NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`collaborateurcollaboreprojet`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurcollaboreprojet` (
`CollaborateurId` INT NOT NULL,
`ProjetId` INT NOT NULL,
`isManager` TINYINT(1) NOT NULL,
PRIMARY KEY (`CollaborateurId`, `ProjetId`),
INDEX `FK_PROJET_COLLABORE_COLLABORATEUR` (`ProjetId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_COLLABORE_PROJET`
FOREIGN KEY (`CollaborateurId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`),
CONSTRAINT `FK_PROJET_COLLABORE_COLLABORATEUR`
FOREIGN KEY (`ProjetId`)
REFERENCES `collaborateur_epa`.`projet` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`periodeessai`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`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,
`CollaborateurId` INT NOT NULL,
PRIMARY KEY (`Id`),
INDEX `FK_COLLABORATEUR_PERIODEESSAI` (`CollaborateurId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_PERIODEESSAI`
FOREIGN KEY (`CollaborateurId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`collaborateureffectueperiodeessai`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateureffectueperiodeessai` (
`CollaborateurId` INT NOT NULL,
`PeriodeEssaiId` INT NOT NULL,
PRIMARY KEY (`CollaborateurId`, `PeriodeEssaiId`),
INDEX `FK_PERIODE_ESSAI_COLLABORATEUR` (`PeriodeEssaiId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_PERIODE_ESSAI`
FOREIGN KEY (`CollaborateurId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`),
CONSTRAINT `FK_PERIODE_ESSAI_COLLABORATEUR`
FOREIGN KEY (`PeriodeEssaiId`)
REFERENCES `collaborateur_epa`.`periodeessai` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`fonction`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`fonction` (
`Id` INT NOT NULL,
`intitule` VARCHAR(100) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Id` (`Id` ASC) VISIBLE,
UNIQUE INDEX `intitule` (`intitule` ASC) VISIBLE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`collaborateurestfonction`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`collaborateurestfonction` (
`CollaborateurId` INT NOT NULL,
`FonctionId` INT NOT NULL,
PRIMARY KEY (`CollaborateurId`, `FonctionId`),
INDEX `FK_FONCTION_COLLABORATEUR` (`FonctionId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_FONCTION`
FOREIGN KEY (`CollaborateurId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`),
CONSTRAINT `FK_FONCTION_COLLABORATEUR`
FOREIGN KEY (`FonctionId`)
REFERENCES `collaborateur_epa`.`fonction` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`technologie`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`technologie` (
`Id` INT NOT NULL,
`Name` VARCHAR(100) NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Id` (`Id` ASC) VISIBLE,
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE)
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`projetutilisetechnologie`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`projetutilisetechnologie` (
`ProjetId` INT NOT NULL,
`TechnologieId` INT NOT NULL,
PRIMARY KEY (`ProjetId`, `TechnologieId`),
INDEX `FK_TECHNOLOGIE_PROJET` (`TechnologieId` ASC) VISIBLE,
CONSTRAINT `FK_PROJET_TECHNOLOGIE`
FOREIGN KEY (`ProjetId`)
REFERENCES `collaborateur_epa`.`projet` (`Id`),
CONSTRAINT `FK_TECHNOLOGIE_PROJET`
FOREIGN KEY (`TechnologieId`)
REFERENCES `collaborateur_epa`.`technologie` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`referencement`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`referencement` (
`Id` INT NOT NULL AUTO_INCREMENT,
`StartingDate` DATE NOT NULL,
`EndingDate` DATE NOT NULL,
`ReferredId` INT NOT NULL,
`ReferrerId` INT NOT NULL,
PRIMARY KEY (`Id`),
INDEX `FK_COLLABORATEUR_REFERE` (`ReferredId` ASC) VISIBLE,
INDEX `FK_COLLABORATEUR_REFERENT` (`ReferrerId` ASC) VISIBLE,
CONSTRAINT `FK_COLLABORATEUR_REFERE`
FOREIGN KEY (`ReferredId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`),
CONSTRAINT `FK_COLLABORATEUR_REFERENT`
FOREIGN KEY (`ReferrerId`)
REFERENCES `collaborateur_epa`.`collaborateur` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`site`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`site` (
`Id` INT NOT NULL AUTO_INCREMENT,
`Name` VARCHAR(100) NOT NULL,
`Address` VARCHAR(200) NOT NULL,
`BusinessUnitId` INT NOT NULL,
PRIMARY KEY (`Id`),
UNIQUE INDEX `Name` (`Name` ASC) VISIBLE,
INDEX `FK_SITE_BUSINESS_UNIT` (`BusinessUnitId` ASC) VISIBLE,
CONSTRAINT `FK_SITE_BUSINESS_UNIT`
FOREIGN KEY (`BusinessUnitId`)
REFERENCES `collaborateur_epa`.`businessunit` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
-- -----------------------------------------------------
-- Table `collaborateur_epa`.`sitedeveloppeprojet`
-- -----------------------------------------------------
CREATE TABLE IF NOT EXISTS `collaborateur_epa`.`sitedeveloppeprojet` (
`SiteId` INT NOT NULL,
`ProjetId` INT NOT NULL,
PRIMARY KEY (`SiteId`, `ProjetId`),
INDEX `FK_PROJET_SITE` (`ProjetId` ASC) VISIBLE,
CONSTRAINT `FK_PROJET_SITE`
FOREIGN KEY (`ProjetId`)
REFERENCES `collaborateur_epa`.`projet` (`Id`),
CONSTRAINT `FK_SITE_PROJET`
FOREIGN KEY (`SiteId`)
REFERENCES `collaborateur_epa`.`site` (`Id`))
ENGINE = InnoDB
DEFAULT CHARACTER SET = latin1;
SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
Loading…
Cancel
Save