Compare commits
3 Commits
master
...
feat/model
Author | SHA1 | Date | |
---|---|---|---|
85764d41ad | |||
e03e678948 | |||
0315a46587 |
10
.docker/docker-compose.debug.yml
Normal file
10
.docker/docker-compose.debug.yml
Normal file
@ -0,0 +1,10 @@
|
||||
# Please refer https://aka.ms/HTTPSinContainer on how to setup an https developer certificate for your ASP .NET Core service.
|
||||
version: '3.4'
|
||||
|
||||
services:
|
||||
internship.api:
|
||||
environment:
|
||||
- ASPNETCORE_ENVIRONMENT=Development
|
||||
- ASPNETCORE_URLS=http://+:80
|
||||
volumes:
|
||||
- ~/.vsdbg:/remote_debugger:rw
|
@ -1,9 +1,16 @@
|
||||
version: "3.3"
|
||||
services:
|
||||
|
||||
internship.api:
|
||||
image: internship.api:latest
|
||||
build: ../src/Internship.Api
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
|
||||
internship.api:
|
||||
image: internship.api:latest
|
||||
build: ../src/Internship.Api
|
||||
ports:
|
||||
- 8080:80
|
||||
|
||||
db.postgres:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: szwoniu
|
||||
ports:
|
||||
- 5432:5432
|
24
.dockerignore
Normal file
24
.dockerignore
Normal file
@ -0,0 +1,24 @@
|
||||
**/.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
|
||||
README.md
|
52
.vscode/launch.json
vendored
52
.vscode/launch.json
vendored
@ -4,33 +4,31 @@
|
||||
// For further information visit https://github.com/OmniSharp/omnisharp-vscode/blob/master/debugger-launchjson.md
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"name": ".NET Core Launch (web)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
// If you have changed target frameworks, make sure to update the program path.
|
||||
"program": "${workspaceFolder}/src/Internship.Api/bin/Debug/netcoreapp3.1/Internship.Api.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/Internship.Api",
|
||||
"stopAtEntry": false,
|
||||
// Enable launching a web browser when ASP.NET Core starts. For more information: https://aka.ms/VSCode-CS-LaunchJson-WebBrowser
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
|
||||
},
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"sourceFileMap": {
|
||||
"/Views": "${workspaceFolder}/Views"
|
||||
}
|
||||
{
|
||||
"name": ".NET Core Launch (web)",
|
||||
"type": "coreclr",
|
||||
"request": "launch",
|
||||
"preLaunchTask": "build",
|
||||
"program": "${workspaceFolder}/src/Internship.Api/bin/Debug/netcoreapp3.1/Internship.Api.dll",
|
||||
"args": [],
|
||||
"cwd": "${workspaceFolder}/src/Internship.Api",
|
||||
"stopAtEntry": false,
|
||||
"serverReadyAction": {
|
||||
"action": "openExternally",
|
||||
"pattern": "^\\s*Now listening on:\\s+(https?://\\S+)"
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
"env": {
|
||||
"ASPNETCORE_ENVIRONMENT": "Development"
|
||||
},
|
||||
"sourceFileMap": {
|
||||
"/Views": "${workspaceFolder}/Views"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": ".NET Core Attach",
|
||||
"type": "coreclr",
|
||||
"request": "attach",
|
||||
"processId": "${command:pickProcess}"
|
||||
}
|
||||
]
|
||||
}
|
6
.vscode/settings.json
vendored
Normal file
6
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"files.exclude": {
|
||||
"**/bin": true,
|
||||
"**/obj": true
|
||||
}
|
||||
}
|
23
.vscode/tasks.json
vendored
23
.vscode/tasks.json
vendored
@ -37,6 +37,27 @@
|
||||
"/consoleloggerparameters:NoSummary"
|
||||
],
|
||||
"problemMatcher": "$msCompile"
|
||||
}
|
||||
},
|
||||
{
|
||||
"label": "up",
|
||||
"type": "shell",
|
||||
"command": "docker-compose",
|
||||
"args": [
|
||||
"-f",
|
||||
".docker/docker-compose.yaml",
|
||||
"up",
|
||||
"--build"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
{
|
||||
"label": "dotnet restore",
|
||||
"type": "shell",
|
||||
"command": "dotnet",
|
||||
"args": [
|
||||
"restore"
|
||||
],
|
||||
"problemMatcher": []
|
||||
},
|
||||
]
|
||||
}
|
@ -1,5 +1,5 @@
|
||||
{
|
||||
"sdk": {
|
||||
"version": "3.1.200"
|
||||
"version": "3.1.103"
|
||||
}
|
||||
}
|
@ -1,2 +1,24 @@
|
||||
bin\
|
||||
obj\
|
||||
**/.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
|
||||
README.md
|
@ -6,6 +6,7 @@
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
|
||||
<PackageReference Include="Serilog" Version="2.9.0" />
|
||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||
|
@ -1,15 +1,8 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.AspNetCore.Hosting;
|
||||
using Microsoft.AspNetCore.HttpsPolicy;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using Microsoft.Extensions.Logging;
|
||||
using Microsoft.OpenApi.Models;
|
||||
|
||||
namespace Internship.Api
|
||||
|
@ -1,6 +1,6 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct Address
|
||||
public class Address
|
||||
{
|
||||
public string Street { get; set; }
|
||||
public string Building { get; set; }
|
||||
|
@ -2,7 +2,9 @@
|
||||
{
|
||||
public class BranchOffice
|
||||
{
|
||||
public Company Company { get; set; }
|
||||
public int Id { get; set; }
|
||||
public Address Address { get; set; }
|
||||
public Company Company { get; set; }
|
||||
public int Provider { get; set; }
|
||||
}
|
||||
}
|
@ -1,12 +1,15 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Company
|
||||
{
|
||||
public string Nip { get; set; }
|
||||
public string Name { get; set; }
|
||||
public RangeOfActivities Range { get; set; }
|
||||
public Uri SiteAddress { get; set; }
|
||||
public string Nip { get; set; }
|
||||
public int Provider { get; set; }
|
||||
public List<BranchOffice> Branches { get; set; }
|
||||
}
|
||||
}
|
@ -2,5 +2,7 @@
|
||||
{
|
||||
public class Course
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public string Name { get; set; }
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct DeanAcceptance
|
||||
public class DeanAcceptance
|
||||
{
|
||||
public DateTime AcceptanceDate { get; set; }
|
||||
public bool IsDeansAcceptanceRequired { get; set; }
|
||||
|
@ -1,12 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Edition
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public DateTime IPPDeadlineDate { get; set; }
|
||||
|
||||
public List<InternshipProgramSubject> Subjects { get; set;}
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public struct Insurance
|
||||
public class Insurance
|
||||
{
|
||||
public DateTime InsuranceDeliveryDate { get; set; }
|
||||
public bool IsInsuranceRequired { get; set; }
|
||||
|
@ -1,21 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class Internship
|
||||
public class InternshipEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Intern Intern { get; set; }
|
||||
public Edition Edition { get; set; }
|
||||
public Report Report { get; set; }
|
||||
public BranchOffice BranchOffice { get; set; }
|
||||
public InternshipProgram Program { get; set; }
|
||||
public InternshipType Type { get; set; }
|
||||
public DateTime StartDate { get; set; }
|
||||
public DateTime EndDate { get; set; }
|
||||
public bool IsAccepted { get; set; }
|
||||
public DeanAcceptance DeanAcceptance { get; set; }
|
||||
public Insurance Insurance { get; set; }
|
||||
|
||||
public int InternshipLengthInWeeks { get; set; }
|
||||
public float Grade { get; set; }
|
||||
public List<InternshipProgramSubject> Program { get; set; }
|
||||
}
|
||||
}
|
@ -1,6 +0,0 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class InternshipProgram
|
||||
{
|
||||
}
|
||||
}
|
9
src/Internship.Core/InternshipProgramSubject.cs
Normal file
9
src/Internship.Core/InternshipProgramSubject.cs
Normal file
@ -0,0 +1,9 @@
|
||||
namespace Internship.Core
|
||||
{
|
||||
public class InternshipProgramSubject
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public Course Course { get; set; }
|
||||
public string Description { get; set; }
|
||||
}
|
||||
}
|
@ -2,7 +2,13 @@
|
||||
{
|
||||
public enum InternshipType
|
||||
{
|
||||
B2B,
|
||||
Free
|
||||
Other,
|
||||
FreeInternship,
|
||||
GraduateInternship,
|
||||
FreeApprenticeship,
|
||||
PaidApprenticeship,
|
||||
EmploymentContract,
|
||||
MandateContract,
|
||||
ContractWork
|
||||
}
|
||||
}
|
@ -2,5 +2,8 @@
|
||||
{
|
||||
public enum RangeOfActivities
|
||||
{
|
||||
Other,
|
||||
National,
|
||||
International
|
||||
}
|
||||
}
|
@ -2,5 +2,6 @@
|
||||
{
|
||||
public class Report
|
||||
{
|
||||
public int Id { get; set; }
|
||||
}
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace Internship.Repository
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
@ -1,12 +1,22 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFramework>netstandard2.0</TargetFramework>
|
||||
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="EFCore.NamingConventions" Version="1.1.0" />
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
|
||||
<PackageReference Include="Serilog" Version="2.9.0" />
|
||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Internship.Core\Internship.Core.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
39
src/Internship.Repository/InternshipDbContext.cs
Normal file
39
src/Internship.Repository/InternshipDbContext.cs
Normal file
@ -0,0 +1,39 @@
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Internship.Core;
|
||||
|
||||
namespace Internship.Repository
|
||||
{
|
||||
public class InternshipDbContext : DbContext
|
||||
{
|
||||
public DbSet<InternshipEntity> Internships { get; set; }
|
||||
public DbSet<Company> Companies { get; set; }
|
||||
public DbSet<Edition> Editions { get; set; }
|
||||
public DbSet<Report> Reports { get; set; }
|
||||
public DbSet<Intern> Interns { get; set; }
|
||||
|
||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
||||
optionsBuilder
|
||||
.UseNpgsql("Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=szwoniu")
|
||||
.UseSnakeCaseNamingConvention();
|
||||
|
||||
protected override void OnModelCreating(ModelBuilder modelBuilder) {
|
||||
modelBuilder
|
||||
.Entity<InternshipEntity>(ie => {
|
||||
ie.OwnsOne(i => i.DeanAcceptance);
|
||||
ie.OwnsOne(i => i.Insurance);
|
||||
});
|
||||
|
||||
modelBuilder
|
||||
.Entity<Company>()
|
||||
.HasKey(c => c.Nip);
|
||||
|
||||
modelBuilder
|
||||
.Entity<BranchOffice>()
|
||||
.OwnsOne(b => b.Address);
|
||||
|
||||
modelBuilder
|
||||
.Entity<Intern>()
|
||||
.HasKey(i => i.AlbumNumber);
|
||||
}
|
||||
}
|
||||
}
|
428
src/Internship.Repository/Migrations/20200612141652_InitialCreate.Designer.cs
generated
Normal file
428
src/Internship.Repository/Migrations/20200612141652_InitialCreate.Designer.cs
generated
Normal file
@ -0,0 +1,428 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Internship.Repository;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Internship.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(InternshipDbContext))]
|
||||
[Migration("20200612141652_InitialCreate")]
|
||||
partial class InitialCreate
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.5")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("CompanyNip")
|
||||
.HasColumnName("company_nip")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Provider")
|
||||
.HasColumnName("provider")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b.HasIndex("CompanyNip")
|
||||
.HasName("ix_branch_office_company_nip");
|
||||
|
||||
b.ToTable("branch_office");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Company", b =>
|
||||
{
|
||||
b.Property<string>("Nip")
|
||||
.HasColumnName("nip")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Provider")
|
||||
.HasColumnName("provider")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnName("range")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("SiteAddress")
|
||||
.HasColumnName("site_address")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Nip")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b.ToTable("companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Course", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_course");
|
||||
|
||||
b.ToTable("course");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Edition", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("EndDate")
|
||||
.HasColumnName("end_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("IPPDeadlineDate")
|
||||
.HasColumnName("ipp_deadline_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnName("start_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_editions");
|
||||
|
||||
b.ToTable("editions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Intern", b =>
|
||||
{
|
||||
b.Property<string>("AlbumNumber")
|
||||
.HasColumnName("album_number")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Semester")
|
||||
.HasColumnName("semester")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Surname")
|
||||
.HasColumnName("surname")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("AlbumNumber")
|
||||
.HasName("pk_interns");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_interns_course_id");
|
||||
|
||||
b.ToTable("interns");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int?>("BranchOfficeId")
|
||||
.HasColumnName("branch_office_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("EndDate")
|
||||
.HasColumnName("end_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<float>("Grade")
|
||||
.HasColumnName("grade")
|
||||
.HasColumnType("real");
|
||||
|
||||
b.Property<string>("InternAlbumNumber")
|
||||
.HasColumnName("intern_album_number")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("InternshipLengthInWeeks")
|
||||
.HasColumnName("internship_length_in_weeks")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsAccepted")
|
||||
.HasColumnName("is_accepted")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int?>("ReportId")
|
||||
.HasColumnName("report_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnName("start_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b.HasIndex("BranchOfficeId")
|
||||
.HasName("ix_internships_branch_office_id");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internships_edition_id");
|
||||
|
||||
b.HasIndex("InternAlbumNumber")
|
||||
.HasName("ix_internships_intern_album_number");
|
||||
|
||||
b.HasIndex("ReportId")
|
||||
.HasName("ix_internships_report_id");
|
||||
|
||||
b.ToTable("internships");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("InternshipEntityId")
|
||||
.HasColumnName("internship_entity_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_program_subject");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_internship_program_subject_course_id");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internship_program_subject_edition_id");
|
||||
|
||||
b.HasIndex("InternshipEntityId")
|
||||
.HasName("ix_internship_program_subject_internship_entity_id");
|
||||
|
||||
b.ToTable("internship_program_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Report", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_reports");
|
||||
|
||||
b.ToTable("reports");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Company", "Company")
|
||||
.WithMany("Branches")
|
||||
.HasForeignKey("CompanyNip")
|
||||
.HasConstraintName("fk_branch_office_companies_company_nip");
|
||||
|
||||
b.OwnsOne("Internship.Core.Address", "Address", b1 =>
|
||||
{
|
||||
b1.Property<int>("BranchOfficeId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<string>("Building")
|
||||
.HasColumnName("building")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("City")
|
||||
.HasColumnName("city")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Country")
|
||||
.HasColumnName("country")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("PostalCode")
|
||||
.HasColumnName("postal_code")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Street")
|
||||
.HasColumnName("street")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.HasKey("BranchOfficeId")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b1.ToTable("branch_office");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("BranchOfficeId")
|
||||
.HasConstraintName("fk_address_branch_office_branch_office_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Intern", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_interns_course_course_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.BranchOffice", "BranchOffice")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchOfficeId")
|
||||
.HasConstraintName("fk_internships_branch_office_branch_office_id");
|
||||
|
||||
b.HasOne("Internship.Core.Edition", "Edition")
|
||||
.WithMany()
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internships_editions_edition_id");
|
||||
|
||||
b.HasOne("Internship.Core.Intern", "Intern")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternAlbumNumber")
|
||||
.HasConstraintName("fk_internships_interns_intern_album_number");
|
||||
|
||||
b.HasOne("Internship.Core.Report", "Report")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReportId")
|
||||
.HasConstraintName("fk_internships_reports_report_id");
|
||||
|
||||
b.OwnsOne("Internship.Core.DeanAcceptance", "DeanAcceptance", b1 =>
|
||||
{
|
||||
b1.Property<int>("InternshipEntityId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<DateTime>("AcceptanceDate")
|
||||
.HasColumnName("acceptance_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b1.Property<bool>("IsDeansAcceptanceRequired")
|
||||
.HasColumnName("is_deans_acceptance_required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.Property<int>("Reason")
|
||||
.HasColumnName("reason")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.HasKey("InternshipEntityId")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b1.ToTable("internships");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_dean_acceptance_internships_internship_entity_id");
|
||||
});
|
||||
|
||||
b.OwnsOne("Internship.Core.Insurance", "Insurance", b1 =>
|
||||
{
|
||||
b1.Property<int>("InternshipEntityId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<DateTime>("InsuranceDeliveryDate")
|
||||
.HasColumnName("insurance_delivery_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b1.Property<bool>("IsInsuranceRequired")
|
||||
.HasColumnName("is_insurance_required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.HasKey("InternshipEntityId")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b1.ToTable("internships");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_insurance_internships_internship_entity_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_internship_program_subject_course_course_id");
|
||||
|
||||
b.HasOne("Internship.Core.Edition", null)
|
||||
.WithMany("Subjects")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internship_program_subject_editions_edition_id");
|
||||
|
||||
b.HasOne("Internship.Core.InternshipEntity", null)
|
||||
.WithMany("Program")
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_internship_program_subject_internships_internship_entity_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,271 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Internship.Repository.Migrations
|
||||
{
|
||||
public partial class InitialCreate : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "companies",
|
||||
columns: table => new
|
||||
{
|
||||
nip = table.Column<string>(nullable: false),
|
||||
name = table.Column<string>(nullable: true),
|
||||
range = table.Column<int>(nullable: false),
|
||||
site_address = table.Column<string>(nullable: true),
|
||||
provider = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_companies", x => x.nip);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "course",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_course", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "editions",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
start_date = table.Column<DateTime>(nullable: false),
|
||||
end_date = table.Column<DateTime>(nullable: false),
|
||||
ipp_deadline_date = table.Column<DateTime>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_editions", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "reports",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_reports", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "branch_office",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
street = table.Column<string>(nullable: true),
|
||||
building = table.Column<string>(nullable: true),
|
||||
city = table.Column<string>(nullable: true),
|
||||
postal_code = table.Column<string>(nullable: true),
|
||||
country = table.Column<string>(nullable: true),
|
||||
company_nip = table.Column<string>(nullable: true),
|
||||
provider = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_branch_office", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_branch_office_companies_company_nip",
|
||||
column: x => x.company_nip,
|
||||
principalTable: "companies",
|
||||
principalColumn: "nip",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "interns",
|
||||
columns: table => new
|
||||
{
|
||||
album_number = table.Column<string>(nullable: false),
|
||||
name = table.Column<string>(nullable: true),
|
||||
surname = table.Column<string>(nullable: true),
|
||||
email = table.Column<string>(nullable: true),
|
||||
course_id = table.Column<int>(nullable: true),
|
||||
semester = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_interns", x => x.album_number);
|
||||
table.ForeignKey(
|
||||
name: "fk_interns_course_course_id",
|
||||
column: x => x.course_id,
|
||||
principalTable: "course",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internships",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
intern_album_number = table.Column<string>(nullable: true),
|
||||
edition_id = table.Column<int>(nullable: true),
|
||||
report_id = table.Column<int>(nullable: true),
|
||||
branch_office_id = table.Column<int>(nullable: true),
|
||||
type = table.Column<int>(nullable: false),
|
||||
start_date = table.Column<DateTime>(nullable: false),
|
||||
end_date = table.Column<DateTime>(nullable: false),
|
||||
is_accepted = table.Column<bool>(nullable: false),
|
||||
acceptance_date = table.Column<DateTime>(nullable: true),
|
||||
is_deans_acceptance_required = table.Column<bool>(nullable: true),
|
||||
reason = table.Column<int>(nullable: true),
|
||||
insurance_delivery_date = table.Column<DateTime>(nullable: true),
|
||||
is_insurance_required = table.Column<bool>(nullable: true),
|
||||
internship_length_in_weeks = table.Column<int>(nullable: false),
|
||||
grade = table.Column<float>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internships", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_internships_branch_office_branch_office_id",
|
||||
column: x => x.branch_office_id,
|
||||
principalTable: "branch_office",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internships_editions_edition_id",
|
||||
column: x => x.edition_id,
|
||||
principalTable: "editions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internships_interns_intern_album_number",
|
||||
column: x => x.intern_album_number,
|
||||
principalTable: "interns",
|
||||
principalColumn: "album_number",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internships_reports_report_id",
|
||||
column: x => x.report_id,
|
||||
principalTable: "reports",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internship_program_subject",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<int>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
course_id = table.Column<int>(nullable: true),
|
||||
description = table.Column<string>(nullable: true),
|
||||
edition_id = table.Column<int>(nullable: true),
|
||||
internship_entity_id = table.Column<int>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship_program_subject", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_program_subject_course_course_id",
|
||||
column: x => x.course_id,
|
||||
principalTable: "course",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_program_subject_editions_edition_id",
|
||||
column: x => x.edition_id,
|
||||
principalTable: "editions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_program_subject_internships_internship_entity_id",
|
||||
column: x => x.internship_entity_id,
|
||||
principalTable: "internships",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_branch_office_company_nip",
|
||||
table: "branch_office",
|
||||
column: "company_nip");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_interns_course_id",
|
||||
table: "interns",
|
||||
column: "course_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_program_subject_course_id",
|
||||
table: "internship_program_subject",
|
||||
column: "course_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_program_subject_edition_id",
|
||||
table: "internship_program_subject",
|
||||
column: "edition_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_program_subject_internship_entity_id",
|
||||
table: "internship_program_subject",
|
||||
column: "internship_entity_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internships_branch_office_id",
|
||||
table: "internships",
|
||||
column: "branch_office_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internships_edition_id",
|
||||
table: "internships",
|
||||
column: "edition_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internships_intern_album_number",
|
||||
table: "internships",
|
||||
column: "intern_album_number");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internships_report_id",
|
||||
table: "internships",
|
||||
column: "report_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship_program_subject");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internships");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "branch_office");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "editions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "interns");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "reports");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "companies");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "course");
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,426 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using Internship.Repository;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace Internship.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(InternshipDbContext))]
|
||||
partial class InternshipDbContextModelSnapshot : ModelSnapshot
|
||||
{
|
||||
protected override void BuildModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.5")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("CompanyNip")
|
||||
.HasColumnName("company_nip")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Provider")
|
||||
.HasColumnName("provider")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b.HasIndex("CompanyNip")
|
||||
.HasName("ix_branch_office_company_nip");
|
||||
|
||||
b.ToTable("branch_office");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Company", b =>
|
||||
{
|
||||
b.Property<string>("Nip")
|
||||
.HasColumnName("nip")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Provider")
|
||||
.HasColumnName("provider")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnName("range")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("SiteAddress")
|
||||
.HasColumnName("site_address")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Nip")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b.ToTable("companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Course", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_course");
|
||||
|
||||
b.ToTable("course");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Edition", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<DateTime>("EndDate")
|
||||
.HasColumnName("end_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("IPPDeadlineDate")
|
||||
.HasColumnName("ipp_deadline_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnName("start_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_editions");
|
||||
|
||||
b.ToTable("editions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Intern", b =>
|
||||
{
|
||||
b.Property<string>("AlbumNumber")
|
||||
.HasColumnName("album_number")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Semester")
|
||||
.HasColumnName("semester")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Surname")
|
||||
.HasColumnName("surname")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("AlbumNumber")
|
||||
.HasName("pk_interns");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_interns_course_id");
|
||||
|
||||
b.ToTable("interns");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int?>("BranchOfficeId")
|
||||
.HasColumnName("branch_office_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("EndDate")
|
||||
.HasColumnName("end_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<float>("Grade")
|
||||
.HasColumnName("grade")
|
||||
.HasColumnType("real");
|
||||
|
||||
b.Property<string>("InternAlbumNumber")
|
||||
.HasColumnName("intern_album_number")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("InternshipLengthInWeeks")
|
||||
.HasColumnName("internship_length_in_weeks")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<bool>("IsAccepted")
|
||||
.HasColumnName("is_accepted")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b.Property<int?>("ReportId")
|
||||
.HasColumnName("report_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<DateTime>("StartDate")
|
||||
.HasColumnName("start_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<int>("Type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b.HasIndex("BranchOfficeId")
|
||||
.HasName("ix_internships_branch_office_id");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internships_edition_id");
|
||||
|
||||
b.HasIndex("InternAlbumNumber")
|
||||
.HasName("ix_internships_intern_album_number");
|
||||
|
||||
b.HasIndex("ReportId")
|
||||
.HasName("ix_internships_report_id");
|
||||
|
||||
b.ToTable("internships");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<int?>("InternshipEntityId")
|
||||
.HasColumnName("internship_entity_id")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_program_subject");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_internship_program_subject_course_id");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internship_program_subject_edition_id");
|
||||
|
||||
b.HasIndex("InternshipEntityId")
|
||||
.HasName("ix_internship_program_subject_internship_entity_id");
|
||||
|
||||
b.ToTable("internship_program_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Report", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_reports");
|
||||
|
||||
b.ToTable("reports");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.BranchOffice", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Company", "Company")
|
||||
.WithMany("Branches")
|
||||
.HasForeignKey("CompanyNip")
|
||||
.HasConstraintName("fk_branch_office_companies_company_nip");
|
||||
|
||||
b.OwnsOne("Internship.Core.Address", "Address", b1 =>
|
||||
{
|
||||
b1.Property<int>("BranchOfficeId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<string>("Building")
|
||||
.HasColumnName("building")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("City")
|
||||
.HasColumnName("city")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Country")
|
||||
.HasColumnName("country")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("PostalCode")
|
||||
.HasColumnName("postal_code")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("Street")
|
||||
.HasColumnName("street")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.HasKey("BranchOfficeId")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b1.ToTable("branch_office");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("BranchOfficeId")
|
||||
.HasConstraintName("fk_address_branch_office_branch_office_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.Intern", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_interns_course_course_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipEntity", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.BranchOffice", "BranchOffice")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchOfficeId")
|
||||
.HasConstraintName("fk_internships_branch_office_branch_office_id");
|
||||
|
||||
b.HasOne("Internship.Core.Edition", "Edition")
|
||||
.WithMany()
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internships_editions_edition_id");
|
||||
|
||||
b.HasOne("Internship.Core.Intern", "Intern")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternAlbumNumber")
|
||||
.HasConstraintName("fk_internships_interns_intern_album_number");
|
||||
|
||||
b.HasOne("Internship.Core.Report", "Report")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReportId")
|
||||
.HasConstraintName("fk_internships_reports_report_id");
|
||||
|
||||
b.OwnsOne("Internship.Core.DeanAcceptance", "DeanAcceptance", b1 =>
|
||||
{
|
||||
b1.Property<int>("InternshipEntityId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<DateTime>("AcceptanceDate")
|
||||
.HasColumnName("acceptance_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b1.Property<bool>("IsDeansAcceptanceRequired")
|
||||
.HasColumnName("is_deans_acceptance_required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.Property<int>("Reason")
|
||||
.HasColumnName("reason")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b1.HasKey("InternshipEntityId")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b1.ToTable("internships");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_dean_acceptance_internships_internship_entity_id");
|
||||
});
|
||||
|
||||
b.OwnsOne("Internship.Core.Insurance", "Insurance", b1 =>
|
||||
{
|
||||
b1.Property<int>("InternshipEntityId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("integer")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<DateTime>("InsuranceDeliveryDate")
|
||||
.HasColumnName("insurance_delivery_date")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b1.Property<bool>("IsInsuranceRequired")
|
||||
.HasColumnName("is_insurance_required")
|
||||
.HasColumnType("boolean");
|
||||
|
||||
b1.HasKey("InternshipEntityId")
|
||||
.HasName("pk_internships");
|
||||
|
||||
b1.ToTable("internships");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_insurance_internships_internship_entity_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
||||
{
|
||||
b.HasOne("Internship.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_internship_program_subject_course_course_id");
|
||||
|
||||
b.HasOne("Internship.Core.Edition", null)
|
||||
.WithMany("Subjects")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internship_program_subject_editions_edition_id");
|
||||
|
||||
b.HasOne("Internship.Core.InternshipEntity", null)
|
||||
.WithMany("Program")
|
||||
.HasForeignKey("InternshipEntityId")
|
||||
.HasConstraintName("fk_internship_program_subject_internships_internship_entity_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -4,7 +4,7 @@ using Machine.Specifications;
|
||||
|
||||
namespace Internship.Core.Tests
|
||||
{
|
||||
[Subject(typeof(Internship))]
|
||||
[Subject(typeof(InternshipEntity))]
|
||||
class When_doing_something
|
||||
{
|
||||
Establish context = () => { };
|
||||
|
Loading…
Reference in New Issue
Block a user