Add Mentor to Intership
This commit is contained in:
parent
61889318a7
commit
43cb068902
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"sdk": {
|
"sdk": {
|
||||||
"version": "3.1.103"
|
"version": "3.1.301"
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -19,5 +19,6 @@ namespace Internship.Core
|
|||||||
public int InternshipLengthInWeeks { get; set; }
|
public int InternshipLengthInWeeks { get; set; }
|
||||||
public float Grade { get; set; }
|
public float Grade { get; set; }
|
||||||
public List<InternshipProgramSubject> Program { get; set; }
|
public List<InternshipProgramSubject> Program { get; set; }
|
||||||
|
public Mentor Mentor { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
9
src/Internship.Core/Mentor.cs
Normal file
9
src/Internship.Core/Mentor.cs
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
namespace Internship.Core
|
||||||
|
{
|
||||||
|
public class Mentor {
|
||||||
|
public string Name { get; set; }
|
||||||
|
public string Surname { get; set; }
|
||||||
|
public string Email { get; set; }
|
||||||
|
public string Phone { get; set; }
|
||||||
|
}
|
||||||
|
}
|
@ -10,7 +10,6 @@ namespace Internship.Repository
|
|||||||
public DbSet<Edition> Editions { get; set; }
|
public DbSet<Edition> Editions { get; set; }
|
||||||
public DbSet<Report> Reports { get; set; }
|
public DbSet<Report> Reports { get; set; }
|
||||||
public DbSet<Intern> Interns { get; set; }
|
public DbSet<Intern> Interns { get; set; }
|
||||||
|
|
||||||
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) =>
|
||||||
optionsBuilder
|
optionsBuilder
|
||||||
.UseNpgsql("Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=szwoniu")
|
.UseNpgsql("Host=localhost;Port=5432;Database=postgres;Username=postgres;Password=szwoniu")
|
||||||
@ -21,6 +20,7 @@ namespace Internship.Repository
|
|||||||
.Entity<InternshipEntity>(ie => {
|
.Entity<InternshipEntity>(ie => {
|
||||||
ie.OwnsOne(i => i.DeanAcceptance);
|
ie.OwnsOne(i => i.DeanAcceptance);
|
||||||
ie.OwnsOne(i => i.Insurance);
|
ie.OwnsOne(i => i.Insurance);
|
||||||
|
ie.OwnsOne(i => i.Mentor);
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder
|
modelBuilder
|
||||||
|
462
src/Internship.Repository/Migrations/20200706165537_AddMentor.Designer.cs
generated
Normal file
462
src/Internship.Repository/Migrations/20200706165537_AddMentor.Designer.cs
generated
Normal file
@ -0,0 +1,462 @@
|
|||||||
|
// <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("20200706165537_AddMentor")]
|
||||||
|
partial class AddMentor
|
||||||
|
{
|
||||||
|
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");
|
||||||
|
});
|
||||||
|
|
||||||
|
b.OwnsOne("Internship.Core.Mentor", "Mentor", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<int>("InternshipEntityId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b1.Property<string>("Emali")
|
||||||
|
.HasColumnName("emali")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Name")
|
||||||
|
.HasColumnName("name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Phone")
|
||||||
|
.HasColumnName("phone")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Surname")
|
||||||
|
.HasColumnName("surname")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.HasKey("InternshipEntityId")
|
||||||
|
.HasName("pk_internships");
|
||||||
|
|
||||||
|
b1.ToTable("internships");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("InternshipEntityId")
|
||||||
|
.HasConstraintName("fk_mentor_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,49 @@
|
|||||||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
||||||
|
|
||||||
|
namespace Internship.Repository.Migrations
|
||||||
|
{
|
||||||
|
public partial class AddMentor : Migration
|
||||||
|
{
|
||||||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "emali",
|
||||||
|
table: "internships",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "name",
|
||||||
|
table: "internships",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "phone",
|
||||||
|
table: "internships",
|
||||||
|
nullable: true);
|
||||||
|
|
||||||
|
migrationBuilder.AddColumn<string>(
|
||||||
|
name: "surname",
|
||||||
|
table: "internships",
|
||||||
|
nullable: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "emali",
|
||||||
|
table: "internships");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "name",
|
||||||
|
table: "internships");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "phone",
|
||||||
|
table: "internships");
|
||||||
|
|
||||||
|
migrationBuilder.DropColumn(
|
||||||
|
name: "surname",
|
||||||
|
table: "internships");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -401,6 +401,40 @@ namespace Internship.Repository.Migrations
|
|||||||
.HasForeignKey("InternshipEntityId")
|
.HasForeignKey("InternshipEntityId")
|
||||||
.HasConstraintName("fk_insurance_internships_internship_entity_id");
|
.HasConstraintName("fk_insurance_internships_internship_entity_id");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
b.OwnsOne("Internship.Core.Mentor", "Mentor", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<int>("InternshipEntityId")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("integer")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b1.Property<string>("Emali")
|
||||||
|
.HasColumnName("emali")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Name")
|
||||||
|
.HasColumnName("name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Phone")
|
||||||
|
.HasColumnName("phone")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.Property<string>("Surname")
|
||||||
|
.HasColumnName("surname")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.HasKey("InternshipEntityId")
|
||||||
|
.HasName("pk_internships");
|
||||||
|
|
||||||
|
b1.ToTable("internships");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("InternshipEntityId")
|
||||||
|
.HasConstraintName("fk_mentor_internships_internship_entity_id");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
modelBuilder.Entity("Internship.Core.InternshipProgramSubject", b =>
|
||||||
|
Loading…
Reference in New Issue
Block a user