next VOL3
This commit is contained in:
parent
2f96bd0e89
commit
b9010f5134
@ -1,68 +1,39 @@
|
||||
// using System.Threading.Tasks;
|
||||
// using InternshipSystem.Repository;
|
||||
// using Microsoft.AspNetCore.Mvc;
|
||||
//
|
||||
// namespace InternshipSystem.Api.Controllers
|
||||
// {
|
||||
// [ApiController]
|
||||
// [Route("admin")]
|
||||
// public class AdminController : ControllerBase
|
||||
// {
|
||||
// public AdminController(DatabaseFiller fillerService)
|
||||
// {
|
||||
// FillerService = fillerService;
|
||||
// }
|
||||
//
|
||||
// public DatabaseFiller FillerService { get; }
|
||||
//
|
||||
//
|
||||
// [HttpPost("fill")]
|
||||
// public async Task<IActionResult> Fill() {
|
||||
// await FillerService.FillCompany();
|
||||
// await FillerService.FillStudents();
|
||||
// await FillerService.FillSubjects();
|
||||
// await FillerService.FillInternshipTypes();
|
||||
// await FillerService.FillEditions();
|
||||
// await FillerService.FillInternShips();
|
||||
// return Ok();
|
||||
// }
|
||||
//
|
||||
// // [HttpPost("fill/companies")]
|
||||
// // public async Task<IActionResult> FillCompaniesAsync()
|
||||
// // {
|
||||
// // await FillerService.FillCompany();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// //
|
||||
// // [HttpPost("fill/students")]
|
||||
// // public async Task<IActionResult> FillStudentsAsync() {
|
||||
// // await FillerService.FillStudents();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// //
|
||||
// // [HttpPost("fill/subjects")]
|
||||
// // public async Task<IActionResult> FillSubjectsAsync()
|
||||
// // {
|
||||
// // await FillerService.FillSubjects();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// //
|
||||
// // [HttpPost("fill/internshiptypes")]
|
||||
// // public async Task<IActionResult> FillInternshipTypesAsync() {
|
||||
// // await FillerService.FillInternshipTypes();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// //
|
||||
// // [HttpPost("fill/editions")]
|
||||
// // public async Task<IActionResult> FillEditionsAsync() {
|
||||
// // await FillerService.FillEditions();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// //
|
||||
// // [HttpPost("fill/internships")]
|
||||
// // public async Task<IActionResult> FillInternShipsAsync() {
|
||||
// // await FillerService.FillInternShips();
|
||||
// // return Ok();
|
||||
// // }
|
||||
// }
|
||||
// }
|
||||
using System.Threading.Tasks;
|
||||
using InternshipSystem.Repository;
|
||||
using Microsoft.AspNetCore.Mvc;
|
||||
|
||||
namespace InternshipSystem.Api.Controllers
|
||||
{
|
||||
[ApiController]
|
||||
[Route("admin")]
|
||||
public class AdminController : ControllerBase
|
||||
{
|
||||
public AdminController(DatabaseFiller fillerService)
|
||||
{
|
||||
FillerService = fillerService;
|
||||
}
|
||||
|
||||
public DatabaseFiller FillerService { get; }
|
||||
|
||||
|
||||
[HttpPost("fill")]
|
||||
public async Task<IActionResult> Fill() {
|
||||
await FillerService.FillCompanies();
|
||||
await FillerService.FillEditions();
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("fill/companies")]
|
||||
public async Task<IActionResult> FillCompaniesAsync()
|
||||
{
|
||||
await FillerService.FillCompanies();
|
||||
return Ok();
|
||||
}
|
||||
|
||||
[HttpPost("fill/editions")]
|
||||
public async Task<IActionResult> FillEditionsAsync() {
|
||||
await FillerService.FillEditions();
|
||||
return Ok();
|
||||
}
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@ namespace InternshipSystem.Api
|
||||
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
|
||||
options.IncludeXmlComments(xmlPath);
|
||||
})
|
||||
// .AddScoped<DatabaseFiller>()
|
||||
.AddScoped<DatabaseFiller>()
|
||||
.AddControllers()
|
||||
;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace InternshipSystem.Core
|
||||
{
|
||||
@ -10,6 +10,7 @@ namespace InternshipSystem.Core
|
||||
public string Name { get; set; }
|
||||
public RangeOfActivity Range { get; set; }
|
||||
public List<BranchOffice> Branches { get; set; }
|
||||
public Uri SiteAddress { get; set; }
|
||||
|
||||
public Company CreateCompany(Nip nip, RangeOfActivity range, string name)
|
||||
{
|
||||
|
@ -7,7 +7,7 @@ namespace InternshipSystem.Core
|
||||
{
|
||||
public class Edition
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public Guid Id { get; set; }
|
||||
public DateTime EditionStart { get; set; }
|
||||
public DateTime EditionFinish { get; set; }
|
||||
public DateTime ReportingStart { get; set; }
|
||||
|
@ -1,10 +1,11 @@
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
using System;
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
|
||||
namespace InternshipSystem.Core.UglyOrmArtifacts
|
||||
{
|
||||
public class EditionSubject
|
||||
{
|
||||
public long EditionId { get; set; }
|
||||
public Guid EditionId { get; set; }
|
||||
public Edition Edition { get; set; }
|
||||
public long InternshipSubjectId { get; set; }
|
||||
public InternshipSubject Subject { get; set; }
|
||||
|
@ -1,313 +1,298 @@
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
// using System.Collections.Immutable;
|
||||
// using System.Linq;
|
||||
// using System.Threading.Tasks;
|
||||
// using InternshipSystem.Core;
|
||||
// using InternshipSystem.Core.Entity.Internship;
|
||||
// using InternshipSystem.Core.UglyOrmArtifacts;
|
||||
// using InternshipSystem.Repository.Model;
|
||||
// using Microsoft.EntityFrameworkCore;
|
||||
//
|
||||
// namespace InternshipSystem.Repository
|
||||
// {
|
||||
// public class DatabaseFiller
|
||||
// {
|
||||
// public DatabaseFiller(InternshipDbContext context)
|
||||
// {
|
||||
// Context = context;
|
||||
// }
|
||||
//
|
||||
// public InternshipDbContext Context { get; }
|
||||
//
|
||||
// public async Task FillCompany()
|
||||
// {
|
||||
// var companies = new List<CompanyReadModel>
|
||||
// {
|
||||
// new CompanyReadModel
|
||||
// {
|
||||
// Name = "Intel",
|
||||
// SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"),
|
||||
// Nip = "9570752316",
|
||||
// Range = RangeOfActivity.International,
|
||||
// Branches = new List<BranchOfficeReadModel>
|
||||
// {
|
||||
// new BranchOfficeReadModel
|
||||
// {
|
||||
// City = "Gdańsk",
|
||||
// Street = "ul. Słowackiego",
|
||||
// Building = "173",
|
||||
// PostalCode = "80-298",
|
||||
// Country = "Poland",
|
||||
// },
|
||||
// new BranchOfficeReadModel
|
||||
// {
|
||||
// City = "Gdańsk",
|
||||
// Street = "Jana z Kolna",
|
||||
// Building = "11",
|
||||
// PostalCode = "80-001",
|
||||
// Country = "Poland",
|
||||
// },
|
||||
// new BranchOfficeReadModel
|
||||
// {
|
||||
// City = "Boston",
|
||||
// Street = "State St",
|
||||
// Building = "53",
|
||||
// PostalCode = "MA 02109",
|
||||
// Country = "Stany Zjednoczone",
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// new CompanyReadModel
|
||||
// {
|
||||
// Name = "Asseco Poland",
|
||||
// SiteAddress = new Uri("http://pl.asseco.com"),
|
||||
// Nip = "5842068320",
|
||||
// Range = RangeOfActivity.National,
|
||||
// Branches = new List<BranchOfficeReadModel>
|
||||
// {
|
||||
// new BranchOfficeReadModel
|
||||
// {
|
||||
// City = "Gdańsk",
|
||||
// Street = "ul. Podolska",
|
||||
// Building = "21",
|
||||
// PostalCode = "81-321",
|
||||
// Country = "Poland"
|
||||
// },
|
||||
// new BranchOfficeReadModel
|
||||
// {
|
||||
// City = "Wrocław",
|
||||
// Street = "Traugutta",
|
||||
// Building = "1/7",
|
||||
// PostalCode = "50-449",
|
||||
// Country = "Poland"
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// await Context.Companies.AddRangeAsync(companies);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
//
|
||||
// public async Task FillStudents()
|
||||
// {
|
||||
// var interns = new List<Student>
|
||||
// {
|
||||
// new Student
|
||||
// {
|
||||
// FirstName = "Jan",
|
||||
// LastName = "Kowalski",
|
||||
// AlbumNumber = 123456,
|
||||
// Email = "s123456@student.pg.edu.pl",
|
||||
// Semester = 4,
|
||||
// },
|
||||
// new Student
|
||||
// {
|
||||
// FirstName = "Adam",
|
||||
// LastName = "Kołek",
|
||||
// AlbumNumber = 102137,
|
||||
// Email = "s102137@student.pg.edu.pl",
|
||||
// Semester = 6,
|
||||
// }
|
||||
// };
|
||||
// await Context.Students.AddRangeAsync(interns);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
//
|
||||
// public async Task FillInternshipTypes()
|
||||
// {
|
||||
// var internshipTypes = new List<InternshipType>
|
||||
// {
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "FreeInternship",
|
||||
// Description = "Praktyka bezpłatna",
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "GraduateInternship"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "FreeApprenticeship"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "PaidApprenticeship",
|
||||
// Description = "np. przemysłowy"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "ForeignInternship",
|
||||
// Description = "np. IAESTE, ERASMUS"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UOP"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UD"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UZ"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "Other",
|
||||
// Description = "Należy wprowadzić samodzielnie"
|
||||
// }
|
||||
// };
|
||||
// await Context.InternshipTypes.AddRangeAsync(internshipTypes);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
//
|
||||
// public async Task FillSubjects()
|
||||
// {
|
||||
// var subjects = new List<InternshipSubject>
|
||||
// {
|
||||
// new InternshipSubject
|
||||
// {
|
||||
// Description = "Modelowanie baz danych"
|
||||
// },
|
||||
// new InternshipSubject
|
||||
// {
|
||||
// Description = "Oprogramowywanie kart graficznych"
|
||||
// },
|
||||
// new InternshipSubject
|
||||
// {
|
||||
// Description = "Projektowanie UI"
|
||||
// }
|
||||
// };
|
||||
// await Context.Subjects.AddRangeAsync(subjects);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
//
|
||||
// public async Task FillEditions()
|
||||
// {
|
||||
// var editions = new List<EditionReadModel>
|
||||
// {
|
||||
// new EditionReadModel
|
||||
// {
|
||||
// EditionStart = new DateTime(2000, 5, 10),
|
||||
// EditionFinish = new DateTime(2000, 11, 10),
|
||||
// ReportingStart = new DateTime(2000, 9, 30),
|
||||
// AvailableSubjects = new List<EditionSubject>
|
||||
// {
|
||||
// new EditionSubject
|
||||
// {
|
||||
// InternshipId = Context.Subjects
|
||||
// .First(i => i.Description.Equals("Modelowanie baz danych"))
|
||||
// .Id,
|
||||
// },
|
||||
// new EditionSubject
|
||||
// {
|
||||
// InternshipId = Context.Subjects
|
||||
// .First(i => i.Description.Equals("Oprogramowywanie kart graficznych"))
|
||||
// .Id
|
||||
// },
|
||||
// new EditionSubject
|
||||
// {
|
||||
// InternshipId = Context.Subjects
|
||||
// .First(i => i.Description.Equals("Projektowanie UI"))
|
||||
// .Id
|
||||
// }
|
||||
// }.ToImmutableList(),
|
||||
// Course = new Course
|
||||
// {
|
||||
// Name = "Informatyka",
|
||||
// }
|
||||
// }
|
||||
// };
|
||||
// await Context.Editions.AddRangeAsync(editions);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
//
|
||||
// public async Task FillInternShips()
|
||||
// {
|
||||
// var intenrships = new List<InternshipReadModel>
|
||||
// {
|
||||
// new InternshipReadModel
|
||||
// {
|
||||
// Student = Context.Students.First(i => i.AlbumNumber.Equals(123456)),
|
||||
// InternshipRegistration = new InternshipRegistrationReadModel()
|
||||
// {
|
||||
// Company = Context.Companies.First(c => c.Nip.Equals("9570752316")), //Intel
|
||||
// Type = Context.InternshipTypes.First(t => t.Type.Equals("UOP")),
|
||||
// Start = new DateTime(2000, 7, 1),
|
||||
// End = new DateTime(2000, 8, 30),
|
||||
// State = DocumentState.Submitted,
|
||||
// BranchAddress =
|
||||
// Context.Companies
|
||||
// .Include(c => c.Branches)
|
||||
// .First(c => c.Nip.Equals("9570752316"))
|
||||
// .Branches
|
||||
// .First(),
|
||||
// },
|
||||
// InternshipProgram = new InternshipProgramReadModel()
|
||||
// {
|
||||
// FirstName = "Horacy",
|
||||
// LastName = "Wościcki",
|
||||
// Email = "howos@intel.com",
|
||||
// PhoneNumber = "605-555-555",
|
||||
// ChosenSubjects = new List<ProgramSubject>
|
||||
// {
|
||||
// new ProgramSubject
|
||||
// {
|
||||
// InternshipSubjectId =
|
||||
// Context.Subjects
|
||||
// .First(s => s.Description.Equals("Projektowanie UI"))
|
||||
// .Id
|
||||
// },
|
||||
// new ProgramSubject
|
||||
// {
|
||||
// InternshipSubjectId =
|
||||
// Context.Subjects
|
||||
// .First(s => s.Description.Equals("Oprogramowywanie kart graficznych"))
|
||||
// .Id
|
||||
// }
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// new InternshipReadModel
|
||||
// {
|
||||
// Student = Context.Students.First(i => i.AlbumNumber == 102137),
|
||||
// InternshipRegistration = new InternshipRegistrationReadModel()
|
||||
// {
|
||||
// Company = Context.Companies.First(c => c.Nip.Equals("5842068320")), //Asseco
|
||||
// Type = Context.InternshipTypes.First(t => t.Type.Equals("UZ")),
|
||||
// Start = new DateTime(2000, 7, 1),
|
||||
// End = new DateTime(2000, 8, 30),
|
||||
// State = DocumentState.Submitted,
|
||||
// BranchAddress =
|
||||
// Context.Companies
|
||||
// .Include(c => c.Branches)
|
||||
// .First(c => c.Nip.Equals("5842068320"))
|
||||
// .Branches
|
||||
// .First(),
|
||||
// },
|
||||
// InternshipProgram = new InternshipProgramReadModel()
|
||||
// {
|
||||
// FirstName = "Henryk",
|
||||
// LastName = "Polaciński",
|
||||
// Email = "hepol@asseco.pl",
|
||||
// PhoneNumber = "555-525-545",
|
||||
// ChosenSubjects = new List<ProgramSubject>
|
||||
// {
|
||||
// new ProgramSubject
|
||||
// {
|
||||
// InternshipSubjectId =
|
||||
// Context.Subjects
|
||||
// .First(s => s.Description.Equals("Modelowanie baz danych"))
|
||||
// .Id
|
||||
// }
|
||||
// },
|
||||
// },
|
||||
// },
|
||||
// };
|
||||
// await Context.Internships.AddRangeAsync(intenrships);
|
||||
// await Context.SaveChangesAsync();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using InternshipSystem.Core;
|
||||
using InternshipSystem.Core.Entity.Internship;
|
||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace InternshipSystem.Repository
|
||||
{
|
||||
public class DatabaseFiller
|
||||
{
|
||||
public DatabaseFiller(InternshipDbContext context)
|
||||
{
|
||||
Context = context;
|
||||
}
|
||||
|
||||
public InternshipDbContext Context { get; }
|
||||
|
||||
public async Task FillCompanies()
|
||||
{
|
||||
var companies = new List<Company>
|
||||
{
|
||||
new Company
|
||||
{
|
||||
Id = 1,
|
||||
Name = "Intel",
|
||||
SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"),
|
||||
Nip = "9570752316",
|
||||
Range = RangeOfActivity.International,
|
||||
Branches = new List<BranchOffice>
|
||||
{
|
||||
new BranchOffice
|
||||
{
|
||||
Address = new BranchAddress
|
||||
{
|
||||
City = "Gdańsk",
|
||||
Street = "ul. Słowackiego",
|
||||
Building = "173",
|
||||
PostalCode = "80-298",
|
||||
Country = "Poland",
|
||||
}
|
||||
},
|
||||
new BranchOffice
|
||||
{
|
||||
Address = new BranchAddress
|
||||
{
|
||||
City = "Gdańsk",
|
||||
Street = "Jana z Kolna",
|
||||
Building = "11",
|
||||
PostalCode = "80-001",
|
||||
Country = "Poland",
|
||||
}
|
||||
},
|
||||
new BranchOffice
|
||||
{
|
||||
Address = new BranchAddress
|
||||
{
|
||||
City = "Boston",
|
||||
Street = "State St",
|
||||
Building = "53",
|
||||
PostalCode = "MA 02109",
|
||||
Country = "Stany Zjednoczone",
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
new Company
|
||||
{
|
||||
Id = 2,
|
||||
Name = "Asseco Poland",
|
||||
SiteAddress = new Uri("http://pl.asseco.com"),
|
||||
Nip = "5842068320",
|
||||
Range = RangeOfActivity.National,
|
||||
Branches = new List<BranchOffice>
|
||||
{
|
||||
new BranchOffice
|
||||
{
|
||||
Address = new BranchAddress
|
||||
{
|
||||
City = "Gdańsk",
|
||||
Street = "ul. Podolska",
|
||||
Building = "21",
|
||||
PostalCode = "81-321",
|
||||
Country = "Poland"
|
||||
}
|
||||
},
|
||||
new BranchOffice
|
||||
{
|
||||
Address = new BranchAddress
|
||||
{
|
||||
City = "Wrocław",
|
||||
Street = "Traugutta",
|
||||
Building = "1/7",
|
||||
PostalCode = "50-449",
|
||||
Country = "Poland"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
await Context.Companies.AddRangeAsync(companies);
|
||||
await Context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
public async Task FillEditions()
|
||||
{
|
||||
var editions = new List<Edition>
|
||||
{
|
||||
new Edition
|
||||
{
|
||||
EditionStart = new DateTime(2000, 5, 10),
|
||||
EditionFinish = new DateTime(2000, 11, 10),
|
||||
ReportingStart = new DateTime(2000, 9, 30),
|
||||
AvailableSubjects = new List<EditionSubject>
|
||||
{
|
||||
new EditionSubject
|
||||
{
|
||||
Subject = new InternshipSubject
|
||||
{
|
||||
Description = "Modelowanie baz danych"
|
||||
}
|
||||
},
|
||||
new EditionSubject
|
||||
{
|
||||
Subject = new InternshipSubject
|
||||
{
|
||||
Description = "Oprogramowywanie kart graficznych"
|
||||
}
|
||||
},
|
||||
new EditionSubject
|
||||
{
|
||||
Subject = new InternshipSubject
|
||||
{
|
||||
Description = "Projektowanie UI"
|
||||
}
|
||||
}
|
||||
},
|
||||
Course = new Course
|
||||
{
|
||||
Name = "Informatyka",
|
||||
},
|
||||
Internships = new List<Internship>(),
|
||||
}
|
||||
};
|
||||
|
||||
var edition = editions.First();
|
||||
edition.Internships.AddRange(
|
||||
new List<Internship>
|
||||
{
|
||||
new Internship
|
||||
{
|
||||
Student = new Student
|
||||
{
|
||||
FirstName = "Jan",
|
||||
LastName = "Kowalski",
|
||||
AlbumNumber = 123456,
|
||||
Email = "s123456@student.pg.edu.pl",
|
||||
Semester = 4,
|
||||
},
|
||||
InternshipRegistration = new InternshipRegistration
|
||||
{
|
||||
Company = Context.Companies.First(c => c.Id.Equals(1)), //Intel
|
||||
Type = new InternshipType
|
||||
{
|
||||
Type = "UOP"
|
||||
},
|
||||
Start = new DateTime(2000, 7, 1),
|
||||
End = new DateTime(2000, 8, 30),
|
||||
State = DocumentState.Submitted,
|
||||
BranchAddress =
|
||||
Context.Companies
|
||||
.Include(c => c.Branches)
|
||||
.First(c => c.Id.Equals(1))
|
||||
.Branches
|
||||
.First(),
|
||||
},
|
||||
InternshipProgram = new InternshipProgram
|
||||
{
|
||||
Mentor = new Mentor
|
||||
{
|
||||
FirstName = "Horacy",
|
||||
LastName = "Wościcki",
|
||||
Email = "howos@intel.com",
|
||||
PhoneNumber = "605-555-555",
|
||||
},
|
||||
ChosenSubjects = new List<ProgramSubject>
|
||||
{
|
||||
new ProgramSubject
|
||||
{
|
||||
Subject = edition.AvailableSubjects
|
||||
.First(s => s.Subject.Description.Equals("Modelowanie baz danych"))
|
||||
.Subject
|
||||
},
|
||||
new ProgramSubject
|
||||
{
|
||||
Subject = edition.AvailableSubjects
|
||||
.First(s => s.Subject.Description.Equals("Projektowanie UI"))
|
||||
.Subject
|
||||
}
|
||||
}
|
||||
},
|
||||
},
|
||||
new Internship
|
||||
{
|
||||
Student = new Student
|
||||
{
|
||||
FirstName = "Adam",
|
||||
LastName = "Kołek",
|
||||
AlbumNumber = 102137,
|
||||
Email = "s102137@student.pg.edu.pl",
|
||||
Semester = 6,
|
||||
},
|
||||
InternshipRegistration = new InternshipRegistration
|
||||
{
|
||||
Company = Context.Companies.First(c => c.Id.Equals(2)), //Asseco
|
||||
Type = new InternshipType
|
||||
{
|
||||
Type = "UZ"
|
||||
},
|
||||
Start = new DateTime(2000, 7, 1),
|
||||
End = new DateTime(2000, 8, 30),
|
||||
State = DocumentState.Submitted,
|
||||
BranchAddress =
|
||||
Context.Companies
|
||||
.Include(c => c.Branches)
|
||||
.First(c => c.Id.Equals(2))
|
||||
.Branches
|
||||
.First(),
|
||||
},
|
||||
InternshipProgram = new InternshipProgram
|
||||
{
|
||||
Mentor = new Mentor
|
||||
{
|
||||
FirstName = "Henryk",
|
||||
LastName = "Polaciński",
|
||||
Email = "hepol@asseco.pl",
|
||||
PhoneNumber = "555-525-545",
|
||||
},
|
||||
ChosenSubjects = new List<ProgramSubject>
|
||||
{
|
||||
new ProgramSubject
|
||||
{
|
||||
Subject = edition.AvailableSubjects
|
||||
.First(s => s.Subject.Description.Equals("Oprogramowywanie kart graficznych"))
|
||||
.Subject
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
await Context.Editions.AddRangeAsync(editions);
|
||||
await Context.SaveChangesAsync();
|
||||
}
|
||||
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "FreeInternship",
|
||||
// Description = "Praktyka bezpłatna",
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "GraduateInternship"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "FreeApprenticeship"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "PaidApprenticeship",
|
||||
// Description = "np. przemysłowy"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "ForeignInternship",
|
||||
// Description = "np. IAESTE, ERASMUS"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UOP"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UD"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "UZ"
|
||||
// },
|
||||
// new InternshipType
|
||||
// {
|
||||
// Type = "Other",
|
||||
// Description = "Należy wprowadzić samodzielnie"
|
||||
// }
|
||||
}
|
||||
}
|
@ -37,12 +37,12 @@ namespace InternshipSystem.Repository
|
||||
.HasKey(subject => new { subject.InternshipProgramId, subject.InternshipSubjectId });
|
||||
|
||||
builder
|
||||
.HasOne<InternshipProgram>()
|
||||
.HasOne(k => k.Program)
|
||||
.WithMany(model => model.ChosenSubjects)
|
||||
.HasForeignKey(subject => subject.InternshipProgramId);
|
||||
|
||||
builder
|
||||
.HasOne<InternshipSubject>()
|
||||
.HasOne(k => k.Subject)
|
||||
.WithMany()
|
||||
.HasForeignKey(subject => subject.InternshipSubjectId);
|
||||
});
|
||||
@ -53,12 +53,12 @@ namespace InternshipSystem.Repository
|
||||
.HasKey(subject => new { subject.EditionId, subject.InternshipSubjectId});
|
||||
|
||||
builder
|
||||
.HasOne<Edition>()
|
||||
.HasOne(k => k.Edition)
|
||||
.WithMany(model => model.AvailableSubjects)
|
||||
.HasForeignKey(p => p.EditionId);
|
||||
|
||||
builder
|
||||
.HasOne<InternshipSubject>()
|
||||
.HasOne(k => k.Subject)
|
||||
.WithMany()
|
||||
.HasForeignKey(subject => subject.InternshipSubjectId);
|
||||
});
|
||||
|
@ -1,692 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using InternshipSystem.Repository;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace InternshipSystem.Repository.Migrations
|
||||
{
|
||||
[DbContext(typeof(InternshipDbContext))]
|
||||
[Migration("20200804152816_Init")]
|
||||
partial class Init
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn)
|
||||
.HasAnnotation("ProductVersion", "3.1.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Approval", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("InternshipId")
|
||||
.HasColumnName("internship_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<byte[]>("Scan")
|
||||
.HasColumnName("scan")
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_approval");
|
||||
|
||||
b.HasIndex("InternshipId")
|
||||
.HasName("ix_approval_internship_id");
|
||||
|
||||
b.ToTable("approval");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("CompanyId")
|
||||
.HasColumnName("company_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b.HasIndex("CompanyId")
|
||||
.HasName("ix_branch_office_company_id");
|
||||
|
||||
b.ToTable("branch_office");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Company", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnName("range")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b.ToTable("companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Course", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_course");
|
||||
|
||||
b.ToTable("course");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<long?>("InternshipId")
|
||||
.HasColumnName("internship_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_document");
|
||||
|
||||
b.HasIndex("InternshipId")
|
||||
.HasName("ix_document_internship_id");
|
||||
|
||||
b.ToTable("document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("EditionFinish")
|
||||
.HasColumnName("edition_finish")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("EditionStart")
|
||||
.HasColumnName("edition_start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("ReportingStart")
|
||||
.HasColumnName("reporting_start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_editions");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_editions_course_id");
|
||||
|
||||
b.ToTable("editions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipSubject", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_subject");
|
||||
|
||||
b.ToTable("internship_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipType", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_type");
|
||||
|
||||
b.ToTable("internship_type");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Internship", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("InternshipProgramId")
|
||||
.HasColumnName("internship_program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("InternshipRegistrationId")
|
||||
.HasColumnName("internship_registration_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("ReportId")
|
||||
.HasColumnName("report_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("StudentId")
|
||||
.HasColumnName("student_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internship_edition_id");
|
||||
|
||||
b.HasIndex("InternshipProgramId")
|
||||
.HasName("ix_internship_internship_program_id");
|
||||
|
||||
b.HasIndex("InternshipRegistrationId")
|
||||
.HasName("ix_internship_internship_registration_id");
|
||||
|
||||
b.HasIndex("ReportId")
|
||||
.HasName("ix_internship_report_id");
|
||||
|
||||
b.HasIndex("StudentId")
|
||||
.HasName("ix_internship_student_id");
|
||||
|
||||
b.ToTable("internship");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipProgram", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b.ToTable("internship_program");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipRegistration", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("BranchAddressId")
|
||||
.HasColumnName("branch_address_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("CompanyId")
|
||||
.HasColumnName("company_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnName("end")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnName("start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long?>("TypeId")
|
||||
.HasColumnName("type_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_registration");
|
||||
|
||||
b.HasIndex("BranchAddressId")
|
||||
.HasName("ix_internship_registration_branch_address_id");
|
||||
|
||||
b.HasIndex("CompanyId")
|
||||
.HasName("ix_internship_registration_company_id");
|
||||
|
||||
b.HasIndex("TypeId")
|
||||
.HasName("ix_internship_registration_type_id");
|
||||
|
||||
b.ToTable("internship_registration");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_report");
|
||||
|
||||
b.ToTable("report");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Student", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("AlbumNumber")
|
||||
.HasColumnName("album_number")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnName("first_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnName("last_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Semester")
|
||||
.HasColumnName("semester")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_student");
|
||||
|
||||
b.ToTable("student");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||
{
|
||||
b.Property<long>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("InternshipSubjectId")
|
||||
.HasColumnName("internship_subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("EditionId1")
|
||||
.HasColumnName("edition_id1")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("SubjectId")
|
||||
.HasColumnName("subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("EditionId", "InternshipSubjectId")
|
||||
.HasName("pk_edition_subject");
|
||||
|
||||
b.HasIndex("EditionId1")
|
||||
.HasName("ix_edition_subject_edition_id1");
|
||||
|
||||
b.HasIndex("InternshipSubjectId")
|
||||
.HasName("ix_edition_subject_internship_subject_id");
|
||||
|
||||
b.HasIndex("SubjectId")
|
||||
.HasName("ix_edition_subject_subject_id");
|
||||
|
||||
b.ToTable("edition_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||
{
|
||||
b.Property<long>("InternshipProgramId")
|
||||
.HasColumnName("internship_program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("InternshipSubjectId")
|
||||
.HasColumnName("internship_subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("ProgramId")
|
||||
.HasColumnName("program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("SubjectId")
|
||||
.HasColumnName("subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("InternshipProgramId", "InternshipSubjectId")
|
||||
.HasName("pk_program_subject");
|
||||
|
||||
b.HasIndex("InternshipSubjectId")
|
||||
.HasName("ix_program_subject_internship_subject_id");
|
||||
|
||||
b.HasIndex("ProgramId")
|
||||
.HasName("ix_program_subject_program_id");
|
||||
|
||||
b.HasIndex("SubjectId")
|
||||
.HasName("ix_program_subject_subject_id");
|
||||
|
||||
b.ToTable("program_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Approval", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Internship", null)
|
||||
.WithMany("Approvals")
|
||||
.HasForeignKey("InternshipId")
|
||||
.HasConstraintName("fk_approval_internship_internship_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Company", null)
|
||||
.WithMany("Branches")
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_branch_office_companies_company_id");
|
||||
|
||||
b.OwnsOne("InternshipSystem.Core.BranchAddress", "Address", b1 =>
|
||||
{
|
||||
b1.Property<long>("BranchOfficeId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.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_branch_address_branch_office_branch_office_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Company", b =>
|
||||
{
|
||||
b.OwnsOne("InternshipSystem.Core.Nip", "Nip", b1 =>
|
||||
{
|
||||
b1.Property<long>("CompanyId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.HasKey("CompanyId")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b1.ToTable("companies");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_nip_companies_company_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Internship", null)
|
||||
.WithMany("Documents")
|
||||
.HasForeignKey("InternshipId")
|
||||
.HasConstraintName("fk_document_internship_internship_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_editions_course_course_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Internship", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Edition", null)
|
||||
.WithMany("Internships")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internship_editions_edition_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", "InternshipProgram")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_internship_internship_program_internship_program_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipRegistration", "InternshipRegistration")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipRegistrationId")
|
||||
.HasConstraintName("fk_internship_internship_registration_internship_registration_");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReportId")
|
||||
.HasConstraintName("fk_internship_report_report_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||
.WithMany()
|
||||
.HasForeignKey("StudentId")
|
||||
.HasConstraintName("fk_internship_student_student_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipProgram", b =>
|
||||
{
|
||||
b.OwnsOne("InternshipSystem.Core.Mentor", "Mentor", b1 =>
|
||||
{
|
||||
b1.Property<long>("InternshipProgramId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("FirstName")
|
||||
.HasColumnName("first_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("LastName")
|
||||
.HasColumnName("last_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.HasKey("InternshipProgramId")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b1.ToTable("internship_program");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_mentor_internship_program_internship_program_id");
|
||||
|
||||
b1.OwnsOne("InternshipSystem.Core.PhoneNumber", "PhoneNumber", b2 =>
|
||||
{
|
||||
b2.Property<long>("MentorInternshipProgramId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b2.HasKey("MentorInternshipProgramId")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b2.ToTable("internship_program");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("MentorInternshipProgramId")
|
||||
.HasConstraintName("fk_phone_number_internship_program_mentor_internship_program_id");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipRegistration", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.BranchOffice", "BranchAddress")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchAddressId")
|
||||
.HasConstraintName("fk_internship_registration_branch_office_branch_address_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Company", "Company")
|
||||
.WithMany()
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_internship_registration_companies_company_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "Type")
|
||||
.WithMany()
|
||||
.HasForeignKey("TypeId")
|
||||
.HasConstraintName("fk_internship_registration_internship_type_type_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Edition", null)
|
||||
.WithMany("AvailableSubjects")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_edition_subject_editions_edition_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||
.WithMany()
|
||||
.HasForeignKey("EditionId1")
|
||||
.HasConstraintName("fk_edition_subject_editions_edition_id1");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipSubjectId")
|
||||
.HasConstraintName("fk_edition_subject_internship_subject_internship_subject_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubjectId")
|
||||
.HasConstraintName("fk_edition_subject_internship_subject_subject_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", null)
|
||||
.WithMany("ChosenSubjects")
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_program_subject_internship_program_internship_program_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipSubjectId")
|
||||
.HasConstraintName("fk_program_subject_internship_subject_internship_subject_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", "Program")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProgramId")
|
||||
.HasConstraintName("fk_program_subject_internship_program_program_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubjectId")
|
||||
.HasConstraintName("fk_program_subject_internship_subject_subject_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
@ -1,497 +0,0 @@
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace InternshipSystem.Repository.Migrations
|
||||
{
|
||||
public partial class Init : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.CreateTable(
|
||||
name: "companies",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
name = table.Column<string>(nullable: true),
|
||||
range = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_companies", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "course",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(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: "internship_program",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
first_name = table.Column<string>(nullable: true),
|
||||
last_name = table.Column<string>(nullable: true),
|
||||
email = table.Column<string>(nullable: true),
|
||||
state = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship_program", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internship_subject",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
description = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship_subject", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internship_type",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
type = table.Column<string>(nullable: true),
|
||||
description = table.Column<string>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship_type", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "report",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
state = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_report", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "student",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
album_number = table.Column<int>(nullable: false),
|
||||
first_name = table.Column<string>(nullable: true),
|
||||
last_name = table.Column<string>(nullable: true),
|
||||
email = table.Column<string>(nullable: true),
|
||||
semester = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_student", x => x.id);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "branch_office",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(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_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_branch_office", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_branch_office_companies_company_id",
|
||||
column: x => x.company_id,
|
||||
principalTable: "companies",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "editions",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
edition_start = table.Column<DateTime>(nullable: false),
|
||||
edition_finish = table.Column<DateTime>(nullable: false),
|
||||
reporting_start = table.Column<DateTime>(nullable: false),
|
||||
course_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_editions", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_editions_course_course_id",
|
||||
column: x => x.course_id,
|
||||
principalTable: "course",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "program_subject",
|
||||
columns: table => new
|
||||
{
|
||||
internship_program_id = table.Column<long>(nullable: false),
|
||||
internship_subject_id = table.Column<long>(nullable: false),
|
||||
program_id = table.Column<long>(nullable: true),
|
||||
subject_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_program_subject", x => new { x.internship_program_id, x.internship_subject_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_program_subject_internship_program_internship_program_id",
|
||||
column: x => x.internship_program_id,
|
||||
principalTable: "internship_program",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "fk_program_subject_internship_subject_internship_subject_id",
|
||||
column: x => x.internship_subject_id,
|
||||
principalTable: "internship_subject",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "fk_program_subject_internship_program_program_id",
|
||||
column: x => x.program_id,
|
||||
principalTable: "internship_program",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_program_subject_internship_subject_subject_id",
|
||||
column: x => x.subject_id,
|
||||
principalTable: "internship_subject",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internship_registration",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
company_id = table.Column<long>(nullable: true),
|
||||
branch_address_id = table.Column<long>(nullable: true),
|
||||
start = table.Column<DateTime>(nullable: false),
|
||||
end = table.Column<DateTime>(nullable: false),
|
||||
type_id = table.Column<long>(nullable: true),
|
||||
state = table.Column<int>(nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship_registration", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_registration_branch_office_branch_address_id",
|
||||
column: x => x.branch_address_id,
|
||||
principalTable: "branch_office",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_registration_companies_company_id",
|
||||
column: x => x.company_id,
|
||||
principalTable: "companies",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_registration_internship_type_type_id",
|
||||
column: x => x.type_id,
|
||||
principalTable: "internship_type",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "edition_subject",
|
||||
columns: table => new
|
||||
{
|
||||
edition_id = table.Column<long>(nullable: false),
|
||||
internship_subject_id = table.Column<long>(nullable: false),
|
||||
edition_id1 = table.Column<long>(nullable: true),
|
||||
subject_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_edition_subject", x => new { x.edition_id, x.internship_subject_id });
|
||||
table.ForeignKey(
|
||||
name: "fk_edition_subject_editions_edition_id",
|
||||
column: x => x.edition_id,
|
||||
principalTable: "editions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "fk_edition_subject_editions_edition_id1",
|
||||
column: x => x.edition_id1,
|
||||
principalTable: "editions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_edition_subject_internship_subject_internship_subject_id",
|
||||
column: x => x.internship_subject_id,
|
||||
principalTable: "internship_subject",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "fk_edition_subject_internship_subject_subject_id",
|
||||
column: x => x.subject_id,
|
||||
principalTable: "internship_subject",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "internship",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
student_id = table.Column<long>(nullable: true),
|
||||
internship_registration_id = table.Column<long>(nullable: true),
|
||||
internship_program_id = table.Column<long>(nullable: true),
|
||||
report_id = table.Column<long>(nullable: true),
|
||||
edition_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_internship", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_editions_edition_id",
|
||||
column: x => x.edition_id,
|
||||
principalTable: "editions",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_internship_program_internship_program_id",
|
||||
column: x => x.internship_program_id,
|
||||
principalTable: "internship_program",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_internship_registration_internship_registration_",
|
||||
column: x => x.internship_registration_id,
|
||||
principalTable: "internship_registration",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_report_report_id",
|
||||
column: x => x.report_id,
|
||||
principalTable: "report",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "fk_internship_student_student_id",
|
||||
column: x => x.student_id,
|
||||
principalTable: "student",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "approval",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
scan = table.Column<byte[]>(nullable: true),
|
||||
state = table.Column<int>(nullable: false),
|
||||
internship_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_approval", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_approval_internship_internship_id",
|
||||
column: x => x.internship_id,
|
||||
principalTable: "internship",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "document",
|
||||
columns: table => new
|
||||
{
|
||||
id = table.Column<long>(nullable: false)
|
||||
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||
description = table.Column<string>(nullable: true),
|
||||
state = table.Column<int>(nullable: false),
|
||||
internship_id = table.Column<long>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("pk_document", x => x.id);
|
||||
table.ForeignKey(
|
||||
name: "fk_document_internship_internship_id",
|
||||
column: x => x.internship_id,
|
||||
principalTable: "internship",
|
||||
principalColumn: "id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_approval_internship_id",
|
||||
table: "approval",
|
||||
column: "internship_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_branch_office_company_id",
|
||||
table: "branch_office",
|
||||
column: "company_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_document_internship_id",
|
||||
table: "document",
|
||||
column: "internship_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_edition_subject_edition_id1",
|
||||
table: "edition_subject",
|
||||
column: "edition_id1");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_edition_subject_internship_subject_id",
|
||||
table: "edition_subject",
|
||||
column: "internship_subject_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_edition_subject_subject_id",
|
||||
table: "edition_subject",
|
||||
column: "subject_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_editions_course_id",
|
||||
table: "editions",
|
||||
column: "course_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_edition_id",
|
||||
table: "internship",
|
||||
column: "edition_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_internship_program_id",
|
||||
table: "internship",
|
||||
column: "internship_program_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_internship_registration_id",
|
||||
table: "internship",
|
||||
column: "internship_registration_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_report_id",
|
||||
table: "internship",
|
||||
column: "report_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_student_id",
|
||||
table: "internship",
|
||||
column: "student_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_registration_branch_address_id",
|
||||
table: "internship_registration",
|
||||
column: "branch_address_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_registration_company_id",
|
||||
table: "internship_registration",
|
||||
column: "company_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_internship_registration_type_id",
|
||||
table: "internship_registration",
|
||||
column: "type_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_program_subject_internship_subject_id",
|
||||
table: "program_subject",
|
||||
column: "internship_subject_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_program_subject_program_id",
|
||||
table: "program_subject",
|
||||
column: "program_id");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "ix_program_subject_subject_id",
|
||||
table: "program_subject",
|
||||
column: "subject_id");
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "approval");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "document");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "edition_subject");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "program_subject");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship_subject");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "editions");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship_program");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship_registration");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "report");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "student");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "course");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "branch_office");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "internship_type");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "companies");
|
||||
}
|
||||
}
|
||||
}
|
@ -1,690 +0,0 @@
|
||||
// <auto-generated />
|
||||
using System;
|
||||
using InternshipSystem.Repository;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Infrastructure;
|
||||
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
||||
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
||||
|
||||
namespace InternshipSystem.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.4")
|
||||
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Approval", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("InternshipId")
|
||||
.HasColumnName("internship_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<byte[]>("Scan")
|
||||
.HasColumnName("scan")
|
||||
.HasColumnType("bytea");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_approval");
|
||||
|
||||
b.HasIndex("InternshipId")
|
||||
.HasName("ix_approval_internship_id");
|
||||
|
||||
b.ToTable("approval");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("CompanyId")
|
||||
.HasColumnName("company_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_branch_office");
|
||||
|
||||
b.HasIndex("CompanyId")
|
||||
.HasName("ix_branch_office_company_id");
|
||||
|
||||
b.ToTable("branch_office");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Company", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Range")
|
||||
.HasColumnName("range")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b.ToTable("companies");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Course", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnName("name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_course");
|
||||
|
||||
b.ToTable("course");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<long?>("InternshipId")
|
||||
.HasColumnName("internship_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_document");
|
||||
|
||||
b.HasIndex("InternshipId")
|
||||
.HasName("ix_document_internship_id");
|
||||
|
||||
b.ToTable("document");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("CourseId")
|
||||
.HasColumnName("course_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("EditionFinish")
|
||||
.HasColumnName("edition_finish")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("EditionStart")
|
||||
.HasColumnName("edition_start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("ReportingStart")
|
||||
.HasColumnName("reporting_start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_editions");
|
||||
|
||||
b.HasIndex("CourseId")
|
||||
.HasName("ix_editions_course_id");
|
||||
|
||||
b.ToTable("editions");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipSubject", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_subject");
|
||||
|
||||
b.ToTable("internship_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.InternshipType", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnName("description")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("Type")
|
||||
.HasColumnName("type")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_type");
|
||||
|
||||
b.ToTable("internship_type");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Internship", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("InternshipProgramId")
|
||||
.HasColumnName("internship_program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("InternshipRegistrationId")
|
||||
.HasColumnName("internship_registration_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("ReportId")
|
||||
.HasColumnName("report_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("StudentId")
|
||||
.HasColumnName("student_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship");
|
||||
|
||||
b.HasIndex("EditionId")
|
||||
.HasName("ix_internship_edition_id");
|
||||
|
||||
b.HasIndex("InternshipProgramId")
|
||||
.HasName("ix_internship_internship_program_id");
|
||||
|
||||
b.HasIndex("InternshipRegistrationId")
|
||||
.HasName("ix_internship_internship_registration_id");
|
||||
|
||||
b.HasIndex("ReportId")
|
||||
.HasName("ix_internship_report_id");
|
||||
|
||||
b.HasIndex("StudentId")
|
||||
.HasName("ix_internship_student_id");
|
||||
|
||||
b.ToTable("internship");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipProgram", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b.ToTable("internship_program");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipRegistration", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<long?>("BranchAddressId")
|
||||
.HasColumnName("branch_address_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("CompanyId")
|
||||
.HasColumnName("company_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<DateTime>("End")
|
||||
.HasColumnName("end")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<DateTime>("Start")
|
||||
.HasColumnName("start")
|
||||
.HasColumnType("timestamp without time zone");
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<long?>("TypeId")
|
||||
.HasColumnName("type_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_internship_registration");
|
||||
|
||||
b.HasIndex("BranchAddressId")
|
||||
.HasName("ix_internship_registration_branch_address_id");
|
||||
|
||||
b.HasIndex("CompanyId")
|
||||
.HasName("ix_internship_registration_company_id");
|
||||
|
||||
b.HasIndex("TypeId")
|
||||
.HasName("ix_internship_registration_type_id");
|
||||
|
||||
b.ToTable("internship_registration");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("State")
|
||||
.HasColumnName("state")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_report");
|
||||
|
||||
b.ToTable("report");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Student", b =>
|
||||
{
|
||||
b.Property<long>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b.Property<int>("AlbumNumber")
|
||||
.HasColumnName("album_number")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("FirstName")
|
||||
.HasColumnName("first_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<string>("LastName")
|
||||
.HasColumnName("last_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b.Property<int>("Semester")
|
||||
.HasColumnName("semester")
|
||||
.HasColumnType("integer");
|
||||
|
||||
b.HasKey("Id")
|
||||
.HasName("pk_student");
|
||||
|
||||
b.ToTable("student");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||
{
|
||||
b.Property<long>("EditionId")
|
||||
.HasColumnName("edition_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("InternshipSubjectId")
|
||||
.HasColumnName("internship_subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("EditionId1")
|
||||
.HasColumnName("edition_id1")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("SubjectId")
|
||||
.HasColumnName("subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("EditionId", "InternshipSubjectId")
|
||||
.HasName("pk_edition_subject");
|
||||
|
||||
b.HasIndex("EditionId1")
|
||||
.HasName("ix_edition_subject_edition_id1");
|
||||
|
||||
b.HasIndex("InternshipSubjectId")
|
||||
.HasName("ix_edition_subject_internship_subject_id");
|
||||
|
||||
b.HasIndex("SubjectId")
|
||||
.HasName("ix_edition_subject_subject_id");
|
||||
|
||||
b.ToTable("edition_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||
{
|
||||
b.Property<long>("InternshipProgramId")
|
||||
.HasColumnName("internship_program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long>("InternshipSubjectId")
|
||||
.HasColumnName("internship_subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("ProgramId")
|
||||
.HasColumnName("program_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.Property<long?>("SubjectId")
|
||||
.HasColumnName("subject_id")
|
||||
.HasColumnType("bigint");
|
||||
|
||||
b.HasKey("InternshipProgramId", "InternshipSubjectId")
|
||||
.HasName("pk_program_subject");
|
||||
|
||||
b.HasIndex("InternshipSubjectId")
|
||||
.HasName("ix_program_subject_internship_subject_id");
|
||||
|
||||
b.HasIndex("ProgramId")
|
||||
.HasName("ix_program_subject_program_id");
|
||||
|
||||
b.HasIndex("SubjectId")
|
||||
.HasName("ix_program_subject_subject_id");
|
||||
|
||||
b.ToTable("program_subject");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Approval", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Internship", null)
|
||||
.WithMany("Approvals")
|
||||
.HasForeignKey("InternshipId")
|
||||
.HasConstraintName("fk_approval_internship_internship_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.BranchOffice", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Company", null)
|
||||
.WithMany("Branches")
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_branch_office_companies_company_id");
|
||||
|
||||
b.OwnsOne("InternshipSystem.Core.BranchAddress", "Address", b1 =>
|
||||
{
|
||||
b1.Property<long>("BranchOfficeId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.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_branch_address_branch_office_branch_office_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Company", b =>
|
||||
{
|
||||
b.OwnsOne("InternshipSystem.Core.Nip", "Nip", b1 =>
|
||||
{
|
||||
b1.Property<long>("CompanyId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.HasKey("CompanyId")
|
||||
.HasName("pk_companies");
|
||||
|
||||
b1.ToTable("companies");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_nip_companies_company_id");
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Document", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Internship", null)
|
||||
.WithMany("Documents")
|
||||
.HasForeignKey("InternshipId")
|
||||
.HasConstraintName("fk_document_internship_internship_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Course", "Course")
|
||||
.WithMany()
|
||||
.HasForeignKey("CourseId")
|
||||
.HasConstraintName("fk_editions_course_course_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.Internship", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Edition", null)
|
||||
.WithMany("Internships")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_internship_editions_edition_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", "InternshipProgram")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_internship_internship_program_internship_program_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipRegistration", "InternshipRegistration")
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipRegistrationId")
|
||||
.HasConstraintName("fk_internship_internship_registration_internship_registration_");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||
.WithMany()
|
||||
.HasForeignKey("ReportId")
|
||||
.HasConstraintName("fk_internship_report_report_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||
.WithMany()
|
||||
.HasForeignKey("StudentId")
|
||||
.HasConstraintName("fk_internship_student_student_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipProgram", b =>
|
||||
{
|
||||
b.OwnsOne("InternshipSystem.Core.Mentor", "Mentor", b1 =>
|
||||
{
|
||||
b1.Property<long>("InternshipProgramId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b1.Property<string>("Email")
|
||||
.HasColumnName("email")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("FirstName")
|
||||
.HasColumnName("first_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.Property<string>("LastName")
|
||||
.HasColumnName("last_name")
|
||||
.HasColumnType("text");
|
||||
|
||||
b1.HasKey("InternshipProgramId")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b1.ToTable("internship_program");
|
||||
|
||||
b1.WithOwner()
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_mentor_internship_program_internship_program_id");
|
||||
|
||||
b1.OwnsOne("InternshipSystem.Core.PhoneNumber", "PhoneNumber", b2 =>
|
||||
{
|
||||
b2.Property<long>("MentorInternshipProgramId")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnName("id")
|
||||
.HasColumnType("bigint")
|
||||
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||
|
||||
b2.HasKey("MentorInternshipProgramId")
|
||||
.HasName("pk_internship_program");
|
||||
|
||||
b2.ToTable("internship_program");
|
||||
|
||||
b2.WithOwner()
|
||||
.HasForeignKey("MentorInternshipProgramId")
|
||||
.HasConstraintName("fk_phone_number_internship_program_mentor_internship_program_id");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.InternshipRegistration", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.BranchOffice", "BranchAddress")
|
||||
.WithMany()
|
||||
.HasForeignKey("BranchAddressId")
|
||||
.HasConstraintName("fk_internship_registration_branch_office_branch_address_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Company", "Company")
|
||||
.WithMany()
|
||||
.HasForeignKey("CompanyId")
|
||||
.HasConstraintName("fk_internship_registration_companies_company_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "Type")
|
||||
.WithMany()
|
||||
.HasForeignKey("TypeId")
|
||||
.HasConstraintName("fk_internship_registration_internship_type_type_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.Edition", null)
|
||||
.WithMany("AvailableSubjects")
|
||||
.HasForeignKey("EditionId")
|
||||
.HasConstraintName("fk_edition_subject_editions_edition_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||
.WithMany()
|
||||
.HasForeignKey("EditionId1")
|
||||
.HasConstraintName("fk_edition_subject_editions_edition_id1");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipSubjectId")
|
||||
.HasConstraintName("fk_edition_subject_internship_subject_internship_subject_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubjectId")
|
||||
.HasConstraintName("fk_edition_subject_internship_subject_subject_id");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||
{
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", null)
|
||||
.WithMany("ChosenSubjects")
|
||||
.HasForeignKey("InternshipProgramId")
|
||||
.HasConstraintName("fk_program_subject_internship_program_internship_program_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", null)
|
||||
.WithMany()
|
||||
.HasForeignKey("InternshipSubjectId")
|
||||
.HasConstraintName("fk_program_subject_internship_subject_internship_subject_id")
|
||||
.OnDelete(DeleteBehavior.Cascade)
|
||||
.IsRequired();
|
||||
|
||||
b.HasOne("InternshipSystem.Core.InternshipProgram", "Program")
|
||||
.WithMany()
|
||||
.HasForeignKey("ProgramId")
|
||||
.HasConstraintName("fk_program_subject_internship_program_program_id");
|
||||
|
||||
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||
.WithMany()
|
||||
.HasForeignKey("SubjectId")
|
||||
.HasConstraintName("fk_program_subject_internship_subject_subject_id");
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user