setup ef core repository & posgre, init migration
This commit is contained in:
parent
e03e678948
commit
85764d41ad
24
src/Internship.Api/.dockerignore
Normal file
24
src/Internship.Api/.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
|
@ -6,6 +6,7 @@
|
|||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="3.1.4" />
|
||||||
<PackageReference Include="Serilog" Version="2.9.0" />
|
<PackageReference Include="Serilog" Version="2.9.0" />
|
||||||
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
<PackageReference Include="Serilog.AspNetCore" Version="3.2.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||||
|
@ -1,12 +1,22 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netcoreapp3.1</TargetFramework>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<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" Version="2.9.0" />
|
||||||
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
<PackageReference Include="Serilog.Sinks.Console" Version="3.1.1" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Internship.Core\Internship.Core.csproj" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user