next VOL3
This commit is contained in:
		
							parent
							
								
									2f96bd0e89
								
							
						
					
					
						commit
						b9010f5134
					
				| @ -1,68 +1,39 @@ | |||||||
| // using System.Threading.Tasks; | using System.Threading.Tasks; | ||||||
| // using InternshipSystem.Repository; | using InternshipSystem.Repository; | ||||||
| // using Microsoft.AspNetCore.Mvc; | using Microsoft.AspNetCore.Mvc; | ||||||
| // | 
 | ||||||
| // namespace InternshipSystem.Api.Controllers | namespace InternshipSystem.Api.Controllers | ||||||
| // { | { | ||||||
| //     [ApiController] |     [ApiController] | ||||||
| //     [Route("admin")] |     [Route("admin")] | ||||||
| //     public class AdminController : ControllerBase |     public class AdminController : ControllerBase | ||||||
| //     { |     { | ||||||
| //         public AdminController(DatabaseFiller fillerService) |         public AdminController(DatabaseFiller fillerService) | ||||||
| //         { |         { | ||||||
| //             FillerService = fillerService; |             FillerService = fillerService; | ||||||
| //         } |         } | ||||||
| // | 
 | ||||||
| //         public DatabaseFiller FillerService { get; } |         public DatabaseFiller FillerService { get; } | ||||||
| // | 
 | ||||||
| //          |          | ||||||
| //         [HttpPost("fill")]  |         [HttpPost("fill")]  | ||||||
| //         public async Task<IActionResult> Fill() { |         public async Task<IActionResult> Fill() { | ||||||
| //             await FillerService.FillCompany(); |             await FillerService.FillCompanies(); | ||||||
| //             await FillerService.FillStudents(); |             await FillerService.FillEditions(); | ||||||
| //             await FillerService.FillSubjects(); |             return Ok(); | ||||||
| //             await FillerService.FillInternshipTypes(); |         } | ||||||
| //             await FillerService.FillEditions(); | 
 | ||||||
| //             await FillerService.FillInternShips(); |         [HttpPost("fill/companies")] | ||||||
| //             return Ok(); |         public async Task<IActionResult> FillCompaniesAsync() | ||||||
| //         } |         { | ||||||
| // |             await FillerService.FillCompanies(); | ||||||
| //         // [HttpPost("fill/companies")] |             return Ok(); | ||||||
| //         // public async Task<IActionResult> FillCompaniesAsync() |         } | ||||||
| //         // { |          | ||||||
| //         //     await FillerService.FillCompany(); |         [HttpPost("fill/editions")] | ||||||
| //         //     return Ok(); |         public async Task<IActionResult> FillEditionsAsync() { | ||||||
| //         // } |             await FillerService.FillEditions(); | ||||||
| //         // |             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(); |  | ||||||
| //         // } |  | ||||||
| //     } |  | ||||||
| // } |  | ||||||
| @ -29,7 +29,7 @@ namespace InternshipSystem.Api | |||||||
|                     var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); |                     var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile); | ||||||
|                     options.IncludeXmlComments(xmlPath); |                     options.IncludeXmlComments(xmlPath); | ||||||
|                 }) |                 }) | ||||||
|                 // .AddScoped<DatabaseFiller>() |                 .AddScoped<DatabaseFiller>() | ||||||
|                 .AddControllers() |                 .AddControllers() | ||||||
|             ; |             ; | ||||||
|          |          | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| using System.Collections.Generic; | using System; | ||||||
| using System.Linq; | using System.Collections.Generic; | ||||||
| 
 | 
 | ||||||
| namespace InternshipSystem.Core | namespace InternshipSystem.Core | ||||||
| { | { | ||||||
| @ -10,6 +10,7 @@ namespace InternshipSystem.Core | |||||||
|         public string Name { get; set; } |         public string Name { get; set; } | ||||||
|         public RangeOfActivity Range { get; set; } |         public RangeOfActivity Range { get; set; } | ||||||
|         public List<BranchOffice> Branches { get; set; } |         public List<BranchOffice> Branches { get; set; } | ||||||
|  |         public Uri SiteAddress { get; set; } | ||||||
| 
 | 
 | ||||||
|         public Company CreateCompany(Nip nip, RangeOfActivity range, string name) |         public Company CreateCompany(Nip nip, RangeOfActivity range, string name) | ||||||
|         { |         { | ||||||
|  | |||||||
| @ -7,7 +7,7 @@ namespace InternshipSystem.Core | |||||||
| { | { | ||||||
|     public class Edition |     public class Edition | ||||||
|     { |     { | ||||||
|         public long Id { get; set; } |         public Guid Id { get; set; } | ||||||
|         public DateTime EditionStart { get; set; } |         public DateTime EditionStart { get; set; } | ||||||
|         public DateTime EditionFinish { get; set; } |         public DateTime EditionFinish { get; set; } | ||||||
|         public DateTime ReportingStart { 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 | namespace InternshipSystem.Core.UglyOrmArtifacts | ||||||
| { | { | ||||||
|     public class EditionSubject |     public class EditionSubject | ||||||
|     { |     { | ||||||
|         public long EditionId { get; set; } |         public Guid EditionId { get; set; } | ||||||
|         public Edition Edition { get; set; } |         public Edition Edition { get; set; } | ||||||
|         public long InternshipSubjectId { get; set; } |         public long InternshipSubjectId { get; set; } | ||||||
|         public InternshipSubject Subject { get; set; } |         public InternshipSubject Subject { get; set; } | ||||||
|  | |||||||
| @ -1,313 +1,298 @@ | |||||||
| // using System; | using System; | ||||||
| // using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| // using System.Collections.Immutable; | using System.Linq; | ||||||
| // using System.Linq; | using System.Threading.Tasks; | ||||||
| // using System.Threading.Tasks; | using InternshipSystem.Core; | ||||||
| // using InternshipSystem.Core; | using InternshipSystem.Core.Entity.Internship; | ||||||
| // using InternshipSystem.Core.Entity.Internship; | using InternshipSystem.Core.UglyOrmArtifacts; | ||||||
| // using InternshipSystem.Core.UglyOrmArtifacts; | using Microsoft.EntityFrameworkCore; | ||||||
| // using InternshipSystem.Repository.Model; | 
 | ||||||
| // using Microsoft.EntityFrameworkCore; | namespace InternshipSystem.Repository | ||||||
| // | { | ||||||
| // namespace InternshipSystem.Repository |     public class DatabaseFiller | ||||||
| // { |     { | ||||||
| //     public class DatabaseFiller |         public DatabaseFiller(InternshipDbContext context) | ||||||
| //     { |         { | ||||||
| //         public DatabaseFiller(InternshipDbContext context) |             Context = context; | ||||||
| //         { |         } | ||||||
| //             Context = context; | 
 | ||||||
| //         } |         public InternshipDbContext Context { get; } | ||||||
| // | 
 | ||||||
| //         public InternshipDbContext Context { get; } |         public async Task FillCompanies() | ||||||
| // |         { | ||||||
| //         public async Task FillCompany() |             var companies = new List<Company> | ||||||
| //         { |             { | ||||||
| //             var companies = new List<CompanyReadModel> |                 new Company | ||||||
| //             { |                 { | ||||||
| //                 new CompanyReadModel |                     Id = 1, | ||||||
| //                 { |                     Name = "Intel", | ||||||
| //                     Name = "Intel", |                     SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"), | ||||||
| //                     SiteAddress = new Uri("https://www.intel.com/content/www/us/en/jobs/locations/poland.html"), |                     Nip = "9570752316", | ||||||
| //                     Nip = "9570752316", |                     Range = RangeOfActivity.International, | ||||||
| //                     Range = RangeOfActivity.International, |                     Branches = new List<BranchOffice> | ||||||
| //                     Branches = new List<BranchOfficeReadModel> |                     { | ||||||
| //                     { |                         new BranchOffice | ||||||
| //                         new BranchOfficeReadModel |                         { | ||||||
| //                         { |                             Address =  new BranchAddress  | ||||||
| //                             City = "Gdańsk", |                             { | ||||||
| //                             Street = "ul. Słowackiego", |                                 City = "Gdańsk", | ||||||
| //                             Building = "173", |                                 Street = "ul. Słowackiego", | ||||||
| //                             PostalCode = "80-298", |                                 Building = "173", | ||||||
| //                             Country = "Poland", |                                 PostalCode = "80-298", | ||||||
| //                         }, |                                 Country = "Poland", | ||||||
| //                         new BranchOfficeReadModel |                             } | ||||||
| //                         { |                         }, | ||||||
| //                             City = "Gdańsk", |                         new BranchOffice | ||||||
| //                             Street = "Jana z Kolna", |                         { | ||||||
| //                             Building = "11", |                             Address =  new BranchAddress  | ||||||
| //                             PostalCode = "80-001", |                             { | ||||||
| //                             Country = "Poland", |                                 City = "Gdańsk", | ||||||
| //                         }, |                                 Street = "Jana z Kolna", | ||||||
| //                         new BranchOfficeReadModel |                                 Building = "11", | ||||||
| //                         { |                                 PostalCode = "80-001", | ||||||
| //                             City = "Boston", |                                 Country = "Poland", | ||||||
| //                             Street = "State St", |                             } | ||||||
| //                             Building = "53", |                         }, | ||||||
| //                             PostalCode = "MA 02109", |                         new BranchOffice | ||||||
| //                             Country = "Stany Zjednoczone", |                         { | ||||||
| //                         } |                             Address =  new BranchAddress  | ||||||
| //                     } |                             { | ||||||
| //                 }, |                                 City = "Boston", | ||||||
| //                 new CompanyReadModel |                                 Street = "State St", | ||||||
| //                 { |                                 Building = "53", | ||||||
| //                     Name = "Asseco Poland", |                                 PostalCode = "MA 02109", | ||||||
| //                     SiteAddress = new Uri("http://pl.asseco.com"), |                                 Country = "Stany Zjednoczone", | ||||||
| //                     Nip = "5842068320", |                             } | ||||||
| //                     Range = RangeOfActivity.National, |                         } | ||||||
| //                     Branches = new List<BranchOfficeReadModel> |                     } | ||||||
| //                     { |                 }, | ||||||
| //                         new BranchOfficeReadModel |                 new Company | ||||||
| //                         { |                 { | ||||||
| //                             City = "Gdańsk", |                     Id = 2, | ||||||
| //                             Street = "ul. Podolska", |                     Name = "Asseco Poland", | ||||||
| //                             Building = "21", |                     SiteAddress = new Uri("http://pl.asseco.com"), | ||||||
| //                             PostalCode = "81-321", |                     Nip = "5842068320", | ||||||
| //                             Country = "Poland" |                     Range = RangeOfActivity.National, | ||||||
| //                         }, |                     Branches = new List<BranchOffice> | ||||||
| //                         new BranchOfficeReadModel |                     { | ||||||
| //                         { |                         new BranchOffice | ||||||
| //                             City = "Wrocław", |                         { | ||||||
| //                             Street = "Traugutta", |                             Address =  new BranchAddress  | ||||||
| //                             Building = "1/7", |                             { | ||||||
| //                             PostalCode = "50-449", |                                 City = "Gdańsk", | ||||||
| //                             Country = "Poland" |                                 Street = "ul. Podolska", | ||||||
| //                         } |                                 Building = "21", | ||||||
| //                     } |                                 PostalCode = "81-321", | ||||||
| //                 } |                                 Country = "Poland" | ||||||
| //             }; |                             } | ||||||
| //             await Context.Companies.AddRangeAsync(companies); |                         }, | ||||||
| //             await Context.SaveChangesAsync(); |                         new BranchOffice | ||||||
| //         } |                         { | ||||||
| // |                             Address =  new BranchAddress  | ||||||
| //         public async Task FillStudents() |                             { | ||||||
| //         { |                                 City = "Wrocław", | ||||||
| //             var interns = new List<Student> |                                 Street = "Traugutta", | ||||||
| //             { |                                 Building = "1/7", | ||||||
| //                 new Student |                                 PostalCode = "50-449", | ||||||
| //                 { |                                 Country = "Poland" | ||||||
| //                     FirstName = "Jan", |                             } | ||||||
| //                     LastName = "Kowalski", |                         } | ||||||
| //                     AlbumNumber = 123456, |                     } | ||||||
| //                     Email = "s123456@student.pg.edu.pl", |                 } | ||||||
| //                     Semester = 4, |             }; | ||||||
| //                 }, |             await Context.Companies.AddRangeAsync(companies); | ||||||
| //                 new Student |             await Context.SaveChangesAsync(); | ||||||
| //                 { |         } | ||||||
| //                     FirstName = "Adam", |          | ||||||
| //                     LastName = "Kołek", |         public async Task FillEditions() | ||||||
| //                     AlbumNumber = 102137, |         { | ||||||
| //                     Email = "s102137@student.pg.edu.pl", |             var editions = new List<Edition> | ||||||
| //                     Semester = 6, |             { | ||||||
| //                 } |                 new Edition | ||||||
| //             }; |                 { | ||||||
| //             await Context.Students.AddRangeAsync(interns); |                     EditionStart = new DateTime(2000, 5, 10), | ||||||
| //             await Context.SaveChangesAsync(); |                     EditionFinish = new DateTime(2000, 11, 10), | ||||||
| //         } |                     ReportingStart = new DateTime(2000, 9, 30), | ||||||
| // |                     AvailableSubjects = new List<EditionSubject> | ||||||
| //         public async Task FillInternshipTypes() |                     { | ||||||
| //         { |                         new EditionSubject | ||||||
| //             var internshipTypes = new List<InternshipType> |                         { | ||||||
| //             { |                             Subject = new InternshipSubject | ||||||
| //                 new InternshipType |                             { | ||||||
| //                 { |                                 Description = "Modelowanie baz danych" | ||||||
| //                     Type = "FreeInternship", |                             } | ||||||
| //                     Description = "Praktyka bezpłatna", |                         }, | ||||||
| //                 }, |                         new EditionSubject | ||||||
| //                 new InternshipType |                         { | ||||||
| //                 { |                             Subject = new InternshipSubject  | ||||||
| //                     Type = "GraduateInternship" |                             { | ||||||
| //                 }, |                                 Description = "Oprogramowywanie kart graficznych" | ||||||
| //                 new InternshipType |                             } | ||||||
| //                 { |                         }, | ||||||
| //                     Type = "FreeApprenticeship" |                         new EditionSubject | ||||||
| //                 }, |                         { | ||||||
| //                 new InternshipType |                             Subject = new InternshipSubject | ||||||
| //                 { |                             { | ||||||
| //                     Type = "PaidApprenticeship", |                                 Description = "Projektowanie UI" | ||||||
| //                     Description = "np. przemysłowy" |                             } | ||||||
| //                 }, |                         } | ||||||
| //                 new InternshipType |                     }, | ||||||
| //                 { |                     Course = new Course | ||||||
| //                     Type = "ForeignInternship", |                     { | ||||||
| //                     Description = "np. IAESTE, ERASMUS" |                         Name = "Informatyka", | ||||||
| //                 }, |                     }, | ||||||
| //                 new InternshipType |                     Internships = new List<Internship>(), | ||||||
| //                 { |                 } | ||||||
| //                     Type = "UOP" |             }; | ||||||
| //                 }, |              | ||||||
| //                 new InternshipType |             var edition = editions.First(); | ||||||
| //                 { |             edition.Internships.AddRange( | ||||||
| //                     Type = "UD" |                 new List<Internship>  | ||||||
| //                 }, |                 { | ||||||
| //                 new InternshipType |                     new Internship | ||||||
| //                 { |                     { | ||||||
| //                     Type = "UZ" |                         Student = new Student | ||||||
| //                 }, |                         { | ||||||
| //                 new InternshipType |                             FirstName = "Jan", | ||||||
| //                 { |                             LastName = "Kowalski", | ||||||
| //                     Type = "Other", |                             AlbumNumber = 123456, | ||||||
| //                     Description = "Należy wprowadzić samodzielnie" |                             Email = "s123456@student.pg.edu.pl", | ||||||
| //                 } |                             Semester = 4, | ||||||
| //             }; |                         }, | ||||||
| //             await Context.InternshipTypes.AddRangeAsync(internshipTypes); |                         InternshipRegistration = new InternshipRegistration | ||||||
| //             await Context.SaveChangesAsync(); |                         { | ||||||
| //         } |                             Company = Context.Companies.First(c => c.Id.Equals(1)), //Intel | ||||||
| // |                             Type =  new InternshipType | ||||||
| //         public async Task FillSubjects() |                             { | ||||||
| //         { |                                 Type = "UOP" | ||||||
| //             var subjects = new List<InternshipSubject> |                             }, | ||||||
| //             { |                             Start = new DateTime(2000, 7, 1), | ||||||
| //                 new InternshipSubject |                             End = new DateTime(2000, 8, 30), | ||||||
| //                 { |                             State = DocumentState.Submitted, | ||||||
| //                     Description = "Modelowanie baz danych" |                             BranchAddress = | ||||||
| //                 }, |                                 Context.Companies | ||||||
| //                 new InternshipSubject |                                     .Include(c => c.Branches) | ||||||
| //                 { |                                     .First(c => c.Id.Equals(1))     | ||||||
| //                     Description = "Oprogramowywanie kart graficznych" |                                     .Branches | ||||||
| //                 }, |                                     .First(), | ||||||
| //                 new InternshipSubject |                         }, | ||||||
| //                 { |                         InternshipProgram = new InternshipProgram | ||||||
| //                     Description = "Projektowanie UI" |                         { | ||||||
| //                 } |                             Mentor = new Mentor  | ||||||
| //             }; |                             { | ||||||
| //             await Context.Subjects.AddRangeAsync(subjects); |                                 FirstName = "Horacy", | ||||||
| //             await Context.SaveChangesAsync(); |                                 LastName = "Wościcki", | ||||||
| //         } |                                 Email = "howos@intel.com", | ||||||
| // |                                 PhoneNumber = "605-555-555", | ||||||
| //         public async Task FillEditions() |                             }, | ||||||
| //         { |                             ChosenSubjects = new List<ProgramSubject> | ||||||
| //             var editions = new List<EditionReadModel> |                             { | ||||||
| //             { |                                 new ProgramSubject | ||||||
| //                 new EditionReadModel |                                 { | ||||||
| //                 { |                                     Subject = edition.AvailableSubjects | ||||||
| //                     EditionStart = new DateTime(2000, 5, 10), |                                         .First(s => s.Subject.Description.Equals("Modelowanie baz danych")) | ||||||
| //                     EditionFinish = new DateTime(2000, 11, 10), |                                         .Subject | ||||||
| //                     ReportingStart = new DateTime(2000, 9, 30), |                                 }, | ||||||
| //                     AvailableSubjects = new List<EditionSubject> |                                 new ProgramSubject | ||||||
| //                     { |                                 { | ||||||
| //                         new EditionSubject |                                     Subject = edition.AvailableSubjects | ||||||
| //                         { |                                         .First(s => s.Subject.Description.Equals("Projektowanie UI")) | ||||||
| //                             InternshipId = Context.Subjects |                                         .Subject | ||||||
| //                                 .First(i => i.Description.Equals("Modelowanie baz danych")) |                                 } | ||||||
| //                                 .Id, |                             } | ||||||
| //                         }, |                         }, | ||||||
| //                         new EditionSubject |                     }, | ||||||
| //                         { |                     new Internship | ||||||
| //                             InternshipId = Context.Subjects |                     { | ||||||
| //                                 .First(i => i.Description.Equals("Oprogramowywanie kart graficznych")) |                         Student = new Student | ||||||
| //                                 .Id |                         { | ||||||
| //                         }, |                             FirstName = "Adam", | ||||||
| //                         new EditionSubject |                             LastName = "Kołek", | ||||||
| //                         { |                             AlbumNumber = 102137, | ||||||
| //                             InternshipId = Context.Subjects |                             Email = "s102137@student.pg.edu.pl", | ||||||
| //                                 .First(i => i.Description.Equals("Projektowanie UI")) |                             Semester = 6, | ||||||
| //                                 .Id |                         }, | ||||||
| //                         } |                         InternshipRegistration = new InternshipRegistration | ||||||
| //                     }.ToImmutableList(), |                         { | ||||||
| //                     Course = new Course |                             Company = Context.Companies.First(c => c.Id.Equals(2)), //Asseco | ||||||
| //                     { |                             Type = new InternshipType | ||||||
| //                         Name = "Informatyka", |                             { | ||||||
| //                     } |                                 Type = "UZ" | ||||||
| //                 } |                             }, | ||||||
| //             }; |                             Start = new DateTime(2000, 7, 1), | ||||||
| //             await Context.Editions.AddRangeAsync(editions); |                             End = new DateTime(2000, 8, 30), | ||||||
| //             await Context.SaveChangesAsync(); |                             State = DocumentState.Submitted, | ||||||
| //         } |                             BranchAddress = | ||||||
| // |                                 Context.Companies | ||||||
| //         public async Task FillInternShips() |                                     .Include(c => c.Branches) | ||||||
| //         { |                                     .First(c => c.Id.Equals(2)) | ||||||
| //             var intenrships = new List<InternshipReadModel> |                                     .Branches | ||||||
| //             { |                                     .First(), | ||||||
| //                 new InternshipReadModel |                         }, | ||||||
| //                 { |                         InternshipProgram = new InternshipProgram | ||||||
| //                     Student = Context.Students.First(i => i.AlbumNumber.Equals(123456)), |                         { | ||||||
| //                     InternshipRegistration = new InternshipRegistrationReadModel() |                             Mentor = new Mentor  | ||||||
| //                     { |                             { | ||||||
| //                         Company = Context.Companies.First(c => c.Nip.Equals("9570752316")), //Intel |                                 FirstName = "Henryk", | ||||||
| //                         Type = Context.InternshipTypes.First(t => t.Type.Equals("UOP")), |                                 LastName = "Polaciński", | ||||||
| //                         Start = new DateTime(2000, 7, 1), |                                 Email = "hepol@asseco.pl", | ||||||
| //                         End = new DateTime(2000, 8, 30), |                                 PhoneNumber = "555-525-545", | ||||||
| //                         State = DocumentState.Submitted, |                             }, | ||||||
| //                         BranchAddress = |                             ChosenSubjects = new List<ProgramSubject> | ||||||
| //                             Context.Companies |                             { | ||||||
| //                                 .Include(c => c.Branches) |                                 new ProgramSubject | ||||||
| //                                 .First(c => c.Nip.Equals("9570752316"))     |                                 { | ||||||
| //                                 .Branches |                                     Subject = edition.AvailableSubjects | ||||||
| //                                 .First(), |                                         .First(s => s.Subject.Description.Equals("Oprogramowywanie kart graficznych")) | ||||||
| //                     }, |                                         .Subject | ||||||
| //                     InternshipProgram = new InternshipProgramReadModel() |                                 } | ||||||
| //                     { |                             }, | ||||||
| //                         FirstName = "Horacy", |                         }, | ||||||
| //                         LastName = "Wościcki", |                     }, | ||||||
| //                         Email = "howos@intel.com", |                 }); | ||||||
| //                         PhoneNumber = "605-555-555", |             await Context.Editions.AddRangeAsync(editions); | ||||||
| //                         ChosenSubjects = new List<ProgramSubject> |             await Context.SaveChangesAsync(); | ||||||
| //                         { |         } | ||||||
| //                             new ProgramSubject |          | ||||||
| //                             { |         // new InternshipType | ||||||
| //                                 InternshipSubjectId =  |         // { | ||||||
| //                                     Context.Subjects |         //     Type = "FreeInternship", | ||||||
| //                                         .First(s => s.Description.Equals("Projektowanie UI")) |         //     Description = "Praktyka bezpłatna", | ||||||
| //                                         .Id |         // }, | ||||||
| //                             }, |         // new InternshipType | ||||||
| //                             new ProgramSubject |         // { | ||||||
| //                             { |         //     Type = "GraduateInternship" | ||||||
| //                                 InternshipSubjectId = |         // }, | ||||||
| //                                     Context.Subjects |         // new InternshipType | ||||||
| //                                         .First(s => s.Description.Equals("Oprogramowywanie kart graficznych")) |         // { | ||||||
| //                                         .Id |         //     Type = "FreeApprenticeship" | ||||||
| //                             } |         // }, | ||||||
| //                         } |         // new InternshipType | ||||||
| //                     }, |         // { | ||||||
| //                 }, |         //     Type = "PaidApprenticeship", | ||||||
| //                 new InternshipReadModel |         //     Description = "np. przemysłowy" | ||||||
| //                 { |         // }, | ||||||
| //                     Student = Context.Students.First(i => i.AlbumNumber == 102137), |         // new InternshipType | ||||||
| //                     InternshipRegistration = new InternshipRegistrationReadModel() |         // { | ||||||
| //                     { |         //     Type = "ForeignInternship", | ||||||
| //                         Company = Context.Companies.First(c => c.Nip.Equals("5842068320")), //Asseco |         //     Description = "np. IAESTE, ERASMUS" | ||||||
| //                         Type = Context.InternshipTypes.First(t => t.Type.Equals("UZ")), |         // }, | ||||||
| //                         Start = new DateTime(2000, 7, 1), |         // new InternshipType | ||||||
| //                         End = new DateTime(2000, 8, 30), |         // { | ||||||
| //                         State = DocumentState.Submitted, |         //     Type = "UOP" | ||||||
| //                         BranchAddress = |         // }, | ||||||
| //                             Context.Companies |         // new InternshipType | ||||||
| //                                 .Include(c => c.Branches) |         // { | ||||||
| //                                 .First(c => c.Nip.Equals("5842068320")) |         //     Type = "UD" | ||||||
| //                                 .Branches |         // }, | ||||||
| //                                 .First(), |         // new InternshipType | ||||||
| //                     }, |         // { | ||||||
| //                     InternshipProgram = new InternshipProgramReadModel() |         //     Type = "UZ" | ||||||
| //                     { |         // }, | ||||||
| //                         FirstName = "Henryk", |         // new InternshipType | ||||||
| //                         LastName = "Polaciński", |         // { | ||||||
| //                         Email = "hepol@asseco.pl", |         //     Type = "Other", | ||||||
| //                         PhoneNumber = "555-525-545", |         //     Description = "Należy wprowadzić samodzielnie" | ||||||
| //                         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(); |  | ||||||
| //         } |  | ||||||
| //     } |  | ||||||
| // } |  | ||||||
| @ -37,12 +37,12 @@ namespace InternshipSystem.Repository | |||||||
|                     .HasKey(subject => new { subject.InternshipProgramId, subject.InternshipSubjectId }); |                     .HasKey(subject => new { subject.InternshipProgramId, subject.InternshipSubjectId }); | ||||||
|                  |                  | ||||||
|                 builder |                 builder | ||||||
|                     .HasOne<InternshipProgram>() |                     .HasOne(k => k.Program) | ||||||
|                     .WithMany(model => model.ChosenSubjects) |                     .WithMany(model => model.ChosenSubjects) | ||||||
|                     .HasForeignKey(subject => subject.InternshipProgramId); |                     .HasForeignKey(subject => subject.InternshipProgramId); | ||||||
|                  |                  | ||||||
|                 builder |                 builder | ||||||
|                     .HasOne<InternshipSubject>() |                     .HasOne(k => k.Subject) | ||||||
|                     .WithMany() |                     .WithMany() | ||||||
|                     .HasForeignKey(subject => subject.InternshipSubjectId); |                     .HasForeignKey(subject => subject.InternshipSubjectId); | ||||||
|             }); |             }); | ||||||
| @ -53,12 +53,12 @@ namespace InternshipSystem.Repository | |||||||
|                     .HasKey(subject => new { subject.EditionId, subject.InternshipSubjectId}); |                     .HasKey(subject => new { subject.EditionId, subject.InternshipSubjectId}); | ||||||
|                  |                  | ||||||
|                 builder |                 builder | ||||||
|                     .HasOne<Edition>() |                     .HasOne(k => k.Edition) | ||||||
|                     .WithMany(model => model.AvailableSubjects) |                     .WithMany(model => model.AvailableSubjects) | ||||||
|                     .HasForeignKey(p => p.EditionId); |                     .HasForeignKey(p => p.EditionId); | ||||||
| 
 | 
 | ||||||
|                 builder |                 builder | ||||||
|                     .HasOne<InternshipSubject>() |                     .HasOne(k => k.Subject) | ||||||
|                     .WithMany() |                     .WithMany() | ||||||
|                     .HasForeignKey(subject => subject.InternshipSubjectId); |                     .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