5fbbd08e3c3b321c1d203b13 #89
@ -25,6 +25,185 @@
|
|||||||
},
|
},
|
||||||
"response": []
|
"response": []
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "GetInternshipManagementList",
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": [
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjI1MTk5LCJleHAiOjE2MTAzMTE1OTksImlhdCI6MTYxMDIyNTE5OX0.KjIUgRh0RwqlA8K3U49ZZKKw8VHxhoW4fHIwUP4lyOc",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"type": "text",
|
||||||
|
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"type": "text",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8080/management/internship?OrderByField=InternshipState&SortOrder=Desc",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8080",
|
||||||
|
"path": [
|
||||||
|
"management",
|
||||||
|
"internship"
|
||||||
|
],
|
||||||
|
"query": [
|
||||||
|
{
|
||||||
|
"key": "OrderByField",
|
||||||
|
"value": "InternshipState"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "SortOrder",
|
||||||
|
"value": "Desc"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "GetInternshipManagement",
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": [
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjI1MTk5LCJleHAiOjE2MTAzMTE1OTksImlhdCI6MTYxMDIyNTE5OX0.KjIUgRh0RwqlA8K3U49ZZKKw8VHxhoW4fHIwUP4lyOc",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "GET",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"type": "text",
|
||||||
|
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"type": "text",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8080/management/internship/1",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8080",
|
||||||
|
"path": [
|
||||||
|
"management",
|
||||||
|
"internship",
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "GetInternshipManagementAccept",
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": [
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjI1MTk5LCJleHAiOjE2MTAzMTE1OTksImlhdCI6MTYxMDIyNTE5OX0.KjIUgRh0RwqlA8K3U49ZZKKw8VHxhoW4fHIwUP4lyOc",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "PUT",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"type": "text",
|
||||||
|
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"type": "text",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8080/management/internship/accept/1",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8080",
|
||||||
|
"path": [
|
||||||
|
"management",
|
||||||
|
"internship",
|
||||||
|
"accept",
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "GetInternshipManagementReject",
|
||||||
|
"request": {
|
||||||
|
"auth": {
|
||||||
|
"type": "bearer",
|
||||||
|
"bearer": [
|
||||||
|
{
|
||||||
|
"key": "token",
|
||||||
|
"value": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjEwMjI1MTk5LCJleHAiOjE2MTAzMTE1OTksImlhdCI6MTYxMDIyNTE5OX0.KjIUgRh0RwqlA8K3U49ZZKKw8VHxhoW4fHIwUP4lyOc",
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"method": "PUT",
|
||||||
|
"header": [
|
||||||
|
{
|
||||||
|
"key": "Authorization",
|
||||||
|
"type": "text",
|
||||||
|
"value": "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1bmlxdWVfbmFtZSI6ImZpcnN0bmFtZSIsImZhbWlseV9uYW1lIjoibGFzdG5hbWUiLCJQZXJzb25OdW1iZXIiOiIxIiwibmJmIjoxNjAxMTk3NTYzLCJleHAiOjE2MDEyODM5NjMsImlhdCI6MTYwMTE5NzU2MywiRWRpdGlvbiI6IjEzOGRhOGEzLTg1NWMtNGIxNy05YmQyLTVmMzU3Njc5ZWZhOSJ9.l7QK1eUIJexnDaFKZ9yx3NWxmB2KrvPpjLUuuP1EJyE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"key": "Content-Type",
|
||||||
|
"type": "text",
|
||||||
|
"value": "application/json"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"url": {
|
||||||
|
"raw": "http://localhost:8080/management/internship/reject/1",
|
||||||
|
"protocol": "http",
|
||||||
|
"host": [
|
||||||
|
"localhost"
|
||||||
|
],
|
||||||
|
"port": "8080",
|
||||||
|
"path": [
|
||||||
|
"management",
|
||||||
|
"internship",
|
||||||
|
"reject",
|
||||||
|
"1"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"response": []
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "loginEdition",
|
"name": "loginEdition",
|
||||||
"request": {
|
"request": {
|
||||||
|
@ -0,0 +1,141 @@
|
|||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using InternshipSystem.Api.Queries.SearchQuery;
|
||||||
|
using InternshipSystem.Api.Security;
|
||||||
|
using InternshipSystem.Core;
|
||||||
|
using InternshipSystem.Core.Entity.Internship;
|
||||||
|
using InternshipSystem.Repository;
|
||||||
|
using Microsoft.AspNetCore.Authorization;
|
||||||
|
using Microsoft.AspNetCore.Http;
|
||||||
|
using Microsoft.AspNetCore.Mvc;
|
||||||
|
using Microsoft.EntityFrameworkCore;
|
||||||
|
|
||||||
|
namespace InternshipSystem.Api.Controllers
|
||||||
|
{
|
||||||
|
[ApiController]
|
||||||
|
[Route("management/internship")]
|
||||||
|
public class InternshipManagementController : ControllerBase
|
||||||
|
{
|
||||||
|
private InternshipDbContext Context { get; }
|
||||||
|
|
||||||
|
public InternshipManagementController(InternshipDbContext context)
|
||||||
|
{
|
||||||
|
Context = context;
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[Authorize(Policy = Policies.IsOverseer)]
|
||||||
|
public async Task<ActionResult<IReadOnlyCollection<Internship>>> GetInternships([FromQuery] InternshipSearchQuery searchQuery, CancellationToken token)
|
||||||
|
{
|
||||||
|
var query =
|
||||||
|
Context.Internships
|
||||||
|
.Include(i => i.Edition)
|
||||||
|
.Include(i => i.InternshipRegistration)
|
||||||
|
.Include(i => i.Student)
|
||||||
|
.Where(i => !searchQuery.EditionId.HasValue || i.Edition.Id.Equals(searchQuery.EditionId))
|
||||||
|
.Where(i => !searchQuery.InternshipState.HasValue || i.InternshipRegistration.State.Equals(searchQuery.InternshipState))
|
||||||
|
.Where(i => !searchQuery.StudentAlbumNumber.HasValue || i.Student.AlbumNumber.Equals(searchQuery.StudentAlbumNumber))
|
||||||
|
.Where(i => string.IsNullOrEmpty(searchQuery.StudentFirstName) || i.Student.FirstName.ToLower().Contains(searchQuery.StudentFirstName.ToLower()))
|
||||||
|
.Where(i => string.IsNullOrEmpty(searchQuery.StudentLastName) || i.Student.LastName.ToLower().Contains(searchQuery.StudentLastName.ToLower()))
|
||||||
|
.Skip(searchQuery.Page * searchQuery.PerPage)
|
||||||
|
.Take(searchQuery.PerPage);
|
||||||
|
|
||||||
|
if (searchQuery.OrderByField.ToLower().Equals("date"))
|
||||||
|
{
|
||||||
|
query = searchQuery.SortOrder.Equals(SortOrder.Desc) ?
|
||||||
|
query.OrderByDescending(i => i.InternshipRegistration.SubmissionDate) :
|
||||||
|
query.OrderBy(i => i.InternshipRegistration.SubmissionDate);
|
||||||
|
}
|
||||||
|
else if (searchQuery.OrderByField.ToLower().Equals("internshipstate"))
|
||||||
|
{
|
||||||
|
query = searchQuery.SortOrder.Equals(SortOrder.Desc) ?
|
||||||
|
query.OrderByDescending(i => i.InternshipRegistration.State) :
|
||||||
|
query.OrderBy(i => i.InternshipRegistration.State);
|
||||||
|
}
|
||||||
|
|
||||||
|
var result = await query.ToListAsync(token);
|
||||||
|
|
||||||
|
return Ok(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpGet("{internshipId}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
[Authorize(Policy = Policies.IsOverseer)]
|
||||||
|
public async Task<ActionResult<Internship>> GetInternship(long internshipId, CancellationToken token)
|
||||||
|
{
|
||||||
|
var internship = await Context.Internships
|
||||||
|
.Include(i => i.Student)
|
||||||
|
.Include(i => i.InternshipRegistration)
|
||||||
|
.Include(i => i.InternshipRegistration.Company)
|
||||||
|
.Include(i => i.InternshipRegistration.BranchAddress)
|
||||||
|
.Include(i => i.InternshipRegistration.Type)
|
||||||
|
.Include(i => i.InternshipRegistration.Subjects)
|
||||||
|
.ThenInclude(subject => subject.Subject)
|
||||||
|
.Include(i => i.InternshipRegistration.Mentor)
|
||||||
|
.Include(i => i.Report)
|
||||||
|
.Include(i => i.Documentation)
|
||||||
|
.Include(i => i.Edition)
|
||||||
|
.Where(i => i.Id.Equals(internshipId))
|
||||||
|
.FirstOrDefaultAsync(token);
|
||||||
|
|
||||||
|
if (internship == null)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Ok(internship);
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("accept/{internshipId}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
[Authorize(Policy = Policies.IsOverseer)]
|
||||||
|
public async Task<ActionResult> AcceptInternship(long internshipId, CancellationToken token)
|
||||||
|
{
|
||||||
|
var internship = await Context.Internships
|
||||||
|
.Include(i => i.InternshipRegistration)
|
||||||
|
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
||||||
|
|
||||||
|
if (internship == null)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
internship.InternshipRegistration.State = DocumentState.Accepted;
|
||||||
|
|
||||||
|
await Context.SaveChangesAsync(token);
|
||||||
|
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
|
||||||
|
[HttpPut("reject/{internshipId}")]
|
||||||
|
[ProducesResponseType(StatusCodes.Status200OK)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status401Unauthorized)]
|
||||||
|
[ProducesResponseType(StatusCodes.Status404NotFound)]
|
||||||
|
[Authorize(Policy = Policies.IsOverseer)]
|
||||||
|
public async Task<ActionResult> RejectInternship(long internshipId, CancellationToken token)
|
||||||
|
{
|
||||||
|
var internship = await Context.Internships
|
||||||
|
.Include(i => i.InternshipRegistration)
|
||||||
|
.FirstOrDefaultAsync(i => i.Id.Equals(internshipId), token);
|
||||||
|
|
||||||
|
if (internship == null)
|
||||||
|
{
|
||||||
|
return NotFound();
|
||||||
|
}
|
||||||
|
|
||||||
|
internship.InternshipRegistration.State = DocumentState.Rejected;
|
||||||
|
|
||||||
|
await Context.SaveChangesAsync(token);
|
||||||
|
|
||||||
|
return Ok();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,64 +1,64 @@
|
|||||||
using System;
|
// using System;
|
||||||
using System.Threading;
|
// using System.Threading;
|
||||||
using System.Threading.Tasks;
|
// using System.Threading.Tasks;
|
||||||
using AutoMapper;
|
// using AutoMapper;
|
||||||
using InternshipSystem.Core;
|
// using InternshipSystem.Core;
|
||||||
using InternshipSystem.Core.Entity;
|
// using InternshipSystem.Core.Entity;
|
||||||
using InternshipSystem.Repository;
|
// using InternshipSystem.Repository;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
// using Microsoft.AspNetCore.Mvc;
|
||||||
|
//
|
||||||
namespace InternshipSystem.Api.Controllers
|
// namespace InternshipSystem.Api.Controllers
|
||||||
{
|
// {
|
||||||
public class ReportFieldsController : ControllerBase
|
// public class ReportFieldsController : ControllerBase
|
||||||
{
|
// {
|
||||||
private readonly InternshipDbContext _context;
|
// private readonly InternshipDbContext _context;
|
||||||
private readonly IMapper _mapper;
|
// private readonly IMapper _mapper;
|
||||||
|
//
|
||||||
public ReportFieldsController(InternshipDbContext context, IMapper mapper)
|
// public ReportFieldsController(InternshipDbContext context, IMapper mapper)
|
||||||
{
|
// {
|
||||||
_context = context;
|
// _context = context;
|
||||||
_mapper = mapper;
|
// _mapper = mapper;
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public async Task<ActionResult> CreateField(FieldCreateRequest request, CancellationToken ct)
|
// public async Task<ActionResult> CreateField(FieldCreateRequest request, CancellationToken ct)
|
||||||
{
|
// {
|
||||||
ReportField field;
|
// ReportField field;
|
||||||
|
//
|
||||||
switch (request.FieldType)
|
// switch (request.FieldType)
|
||||||
{
|
// {
|
||||||
case FieldType.LongText:
|
// case FieldType.LongText:
|
||||||
case FieldType.ShortText:
|
// case FieldType.ShortText:
|
||||||
field = new ReportField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType);
|
// field = new ReportField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType);
|
||||||
break;
|
// break;
|
||||||
case FieldType.Select:
|
// case FieldType.Select:
|
||||||
case FieldType.Radial:
|
// case FieldType.Radial:
|
||||||
case FieldType.Checkbox:
|
// case FieldType.Checkbox:
|
||||||
field = new ReportChoiceField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType, request.Choices);
|
// field = new ReportChoiceField(request.Label, request.LabelEng, request.Description, request.DescriptionEng, request.FieldType, request.Choices);
|
||||||
break;
|
// break;
|
||||||
default:
|
// default:
|
||||||
return BadRequest("Unknown field type");
|
// return BadRequest("Unknown field type");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
try
|
// try
|
||||||
{
|
// {
|
||||||
await _context.ReportFields.AddAsync(field, ct);
|
// await _context.ReportFields.AddAsync(field, ct);
|
||||||
}
|
// }
|
||||||
catch (Exception e)
|
// catch (Exception e)
|
||||||
{
|
// {
|
||||||
return BadRequest("Failed");
|
// return BadRequest("Failed");
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
return Ok();
|
// return Ok();
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
//
|
||||||
public class FieldCreateRequest
|
// public class FieldCreateRequest
|
||||||
{
|
// {
|
||||||
public string Label { get; set; }
|
// public string Label { get; set; }
|
||||||
public string LabelEng { get; set; }
|
// public string LabelEng { get; set; }
|
||||||
public string Description { get; set; }
|
// public string Description { get; set; }
|
||||||
public string DescriptionEng { get; set; }
|
// public string DescriptionEng { get; set; }
|
||||||
public FieldType FieldType { get; set; }
|
// public FieldType FieldType { get; set; }
|
||||||
public string[] Choices { get; set; }
|
// public string[] Choices { get; set; }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
@ -0,0 +1,19 @@
|
|||||||
|
using System;
|
||||||
|
using InternshipSystem.Core;
|
||||||
|
|
||||||
|
namespace InternshipSystem.Api.Queries.SearchQuery
|
||||||
|
{
|
||||||
|
public class InternshipSearchQuery : SearchQuery
|
||||||
|
{
|
||||||
|
public Guid? EditionId { get; set; } = null;
|
||||||
|
public DocumentState? InternshipState { get; set; } = null;
|
||||||
|
public int? StudentAlbumNumber { get; set; } = null;
|
||||||
|
public string StudentFirstName { get; set; } = "";
|
||||||
|
public string StudentLastName { get; set; } = "";
|
||||||
|
/// <summary>
|
||||||
|
/// SortValue: Date, InternshipState
|
||||||
|
/// </summary>
|
||||||
|
public string OrderByField { get; set; } = "";
|
||||||
|
public SortOrder SortOrder { get; set; } = SortOrder.None;
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,9 @@
|
|||||||
|
namespace InternshipSystem.Api.Queries.SearchQuery
|
||||||
|
{
|
||||||
|
public enum SortOrder
|
||||||
|
{
|
||||||
|
Asc,
|
||||||
|
Desc,
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
@ -12,7 +12,6 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
public InternshipRegistration InternshipRegistration { get; set; }
|
public InternshipRegistration InternshipRegistration { get; set; }
|
||||||
public Report Report { get; set; }
|
public Report Report { get; set; }
|
||||||
public List<Document> Documentation { get; set; }
|
public List<Document> Documentation { get; set; }
|
||||||
|
|
||||||
public Edition Edition { get; set; }
|
public Edition Edition { get; set; }
|
||||||
|
|
||||||
public float? Grade { get; set; }
|
public float? Grade { get; set; }
|
||||||
|
@ -1,9 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Data;
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using FluentValidation;
|
using FluentValidation;
|
||||||
using FluentValidation.Results;
|
|
||||||
using InternshipSystem.Core.UglyOrmArtifacts;
|
using InternshipSystem.Core.UglyOrmArtifacts;
|
||||||
|
|
||||||
namespace InternshipSystem.Core.Entity.Internship
|
namespace InternshipSystem.Core.Entity.Internship
|
||||||
@ -13,12 +11,12 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
public long Id { get; set; }
|
public long Id { get; set; }
|
||||||
public Company Company { get; set; }
|
public Company Company { get; set; }
|
||||||
public BranchOffice BranchAddress { get; set; }
|
public BranchOffice BranchAddress { get; set; }
|
||||||
|
public DateTime SubmissionDate { get; set; }
|
||||||
public DateTime Start { get; set; }
|
public DateTime Start { get; set; }
|
||||||
public DateTime End { get; set; }
|
public DateTime End { get; set; }
|
||||||
public Mentor Mentor { get; set; }
|
public Mentor Mentor { get; set; }
|
||||||
public List<ProgramSubject> Subjects { get; set; }
|
public List<ProgramSubject> Subjects { get; set; }
|
||||||
public InternshipType Type { get; set; }
|
public InternshipType Type { get; set; }
|
||||||
|
|
||||||
public int DeclaredHours { get; set; }
|
public int DeclaredHours { get; set; }
|
||||||
public DocumentState State { get; set; }
|
public DocumentState State { get; set; }
|
||||||
|
|
||||||
@ -36,6 +34,8 @@ namespace InternshipSystem.Core.Entity.Internship
|
|||||||
|
|
||||||
State = result.IsValid ? DocumentState.Submitted : DocumentState.Draft;
|
State = result.IsValid ? DocumentState.Submitted : DocumentState.Draft;
|
||||||
|
|
||||||
|
SubmissionDate = DocumentState.Submitted.Equals(State) ? DateTime.UtcNow.AddHours(1) : SubmissionDate;
|
||||||
|
|
||||||
return (State, result.ToErrorDescription());
|
return (State, result.ToErrorDescription());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,6 +305,7 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Company = Context.Companies.First(c => c.Name.Equals("Intel")),
|
Company = Context.Companies.First(c => c.Name.Equals("Intel")),
|
||||||
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o pracę")),
|
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa o pracę")),
|
||||||
|
SubmissionDate = new DateTime(2000, 6, 2),
|
||||||
Start = new DateTime(2000, 7, 1),
|
Start = new DateTime(2000, 7, 1),
|
||||||
End = new DateTime(2000, 8, 30),
|
End = new DateTime(2000, 8, 30),
|
||||||
State = DocumentState.Submitted,
|
State = DocumentState.Submitted,
|
||||||
@ -351,6 +352,7 @@ namespace InternshipSystem.Repository
|
|||||||
{
|
{
|
||||||
Company = Context.Companies.First(c => c.Name.Equals("Asseco Poland")),
|
Company = Context.Companies.First(c => c.Name.Equals("Asseco Poland")),
|
||||||
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa zlecenia (w tym B2B)")),
|
Type = Context.InternshipTypes.First(t => t.Label.Equals("Umowa zlecenia (w tym B2B)")),
|
||||||
|
SubmissionDate = new DateTime(2000, 6, 1),
|
||||||
Start = new DateTime(2000, 7, 1),
|
Start = new DateTime(2000, 7, 1),
|
||||||
End = new DateTime(2000, 8, 30),
|
End = new DateTime(2000, 8, 30),
|
||||||
State = DocumentState.Submitted,
|
State = DocumentState.Submitted,
|
||||||
|
@ -16,6 +16,7 @@ namespace InternshipSystem.Repository
|
|||||||
public DbSet<InternshipType> InternshipTypes { get; set; }
|
public DbSet<InternshipType> InternshipTypes { get; set; }
|
||||||
public DbSet<Student> Students { get; set; }
|
public DbSet<Student> Students { get; set; }
|
||||||
public DbSet<Course> Courses { get; set; }
|
public DbSet<Course> Courses { get; set; }
|
||||||
|
public DbSet<Internship> Internships { get; set; }
|
||||||
|
|
||||||
public DbSet<ReportField> ReportFields { get; set; }
|
public DbSet<ReportField> ReportFields { get; set; }
|
||||||
|
|
||||||
|
702
src/InternshipSystem.Repository/Migrations/20210109193303_init.Designer.cs
generated
Normal file
702
src/InternshipSystem.Repository/Migrations/20210109193303_init.Designer.cs
generated
Normal file
@ -0,0 +1,702 @@
|
|||||||
|
// <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("20210109193303_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.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.Property<long>("Provider")
|
||||||
|
.HasColumnName("provider")
|
||||||
|
.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<string>("Nip")
|
||||||
|
.HasColumnName("nip")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("Provider")
|
||||||
|
.HasColumnName("provider")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_companies");
|
||||||
|
|
||||||
|
b.ToTable("companies");
|
||||||
|
});
|
||||||
|
|
||||||
|
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<string>("RejectionReason")
|
||||||
|
.HasColumnName("rejection_reason")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("State")
|
||||||
|
.HasColumnName("state")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Type")
|
||||||
|
.HasColumnName("type")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_document");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipId")
|
||||||
|
.HasName("ix_document_internship_id");
|
||||||
|
|
||||||
|
b.ToTable("document");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("DocumentId")
|
||||||
|
.HasColumnName("document_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<byte[]>("File")
|
||||||
|
.HasColumnName("file")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<string>("Filename")
|
||||||
|
.HasColumnName("filename")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Mime")
|
||||||
|
.HasColumnName("mime")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("Size")
|
||||||
|
.HasColumnName("size")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("DocumentId")
|
||||||
|
.HasName("pk_document_scan");
|
||||||
|
|
||||||
|
b.ToTable("document_scan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
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.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.Property<string>("NameEng")
|
||||||
|
.HasColumnName("name_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_courses");
|
||||||
|
|
||||||
|
b.ToTable("courses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<Guid?>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<float?>("Grade")
|
||||||
|
.HasColumnName("grade")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
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_internships");
|
||||||
|
|
||||||
|
b.HasIndex("EditionId")
|
||||||
|
.HasName("ix_internships_edition_id");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipRegistrationId")
|
||||||
|
.HasName("ix_internships_internship_registration_id");
|
||||||
|
|
||||||
|
b.HasIndex("ReportId")
|
||||||
|
.HasName("ix_internships_report_id");
|
||||||
|
|
||||||
|
b.HasIndex("StudentId")
|
||||||
|
.HasName("ix_internships_student_id");
|
||||||
|
|
||||||
|
b.ToTable("internships");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.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<int>("DeclaredHours")
|
||||||
|
.HasColumnName("declared_hours")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
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<DateTime>("SubmissionDate")
|
||||||
|
.HasColumnName("submission_date")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
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.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.Property<string>("DescriptionEng")
|
||||||
|
.HasColumnName("description_eng")
|
||||||
|
.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>("DescriptionEng")
|
||||||
|
.HasColumnName("description_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.HasColumnName("label")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LabelEng")
|
||||||
|
.HasColumnName("label_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_internship_types");
|
||||||
|
|
||||||
|
b.ToTable("internship_types");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<int>("Range")
|
||||||
|
.HasColumnName("range")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("SiteAddress")
|
||||||
|
.HasColumnName("site_address")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("State")
|
||||||
|
.HasColumnName("state")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_report");
|
||||||
|
|
||||||
|
b.ToTable("report");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.StaticPage", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<string>("AccessName")
|
||||||
|
.HasColumnName("access_name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Content")
|
||||||
|
.HasColumnName("content")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ContentEng")
|
||||||
|
.HasColumnName("content_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.HasColumnName("title")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("TitleEng")
|
||||||
|
.HasColumnName("title_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_static_pages");
|
||||||
|
|
||||||
|
b.ToTable("static_pages");
|
||||||
|
});
|
||||||
|
|
||||||
|
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>("Course")
|
||||||
|
.HasColumnName("course")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
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_students");
|
||||||
|
|
||||||
|
b.ToTable("students");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipTypeId")
|
||||||
|
.HasColumnName("internship_type_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("EditionId", "InternshipTypeId")
|
||||||
|
.HasName("pk_edition_internship_type");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipTypeId")
|
||||||
|
.HasName("ix_edition_internship_type_internship_type_id");
|
||||||
|
|
||||||
|
b.ToTable("edition_internship_type");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipSubjectId")
|
||||||
|
.HasColumnName("internship_subject_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("EditionId", "InternshipSubjectId")
|
||||||
|
.HasName("pk_edition_subject");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipSubjectId")
|
||||||
|
.HasName("ix_edition_subject_internship_subject_id");
|
||||||
|
|
||||||
|
b.ToTable("edition_subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("InternshipRegistrationId")
|
||||||
|
.HasColumnName("internship_registration_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipSubjectId")
|
||||||
|
.HasColumnName("internship_subject_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("InternshipRegistrationId", "InternshipSubjectId")
|
||||||
|
.HasName("pk_program_subject");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipSubjectId")
|
||||||
|
.HasName("ix_program_subject_internship_subject_id");
|
||||||
|
|
||||||
|
b.ToTable("program_subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.Document", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
||||||
|
.WithMany("Documentation")
|
||||||
|
.HasForeignKey("InternshipId")
|
||||||
|
.HasConstraintName("fk_document_internships_internship_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Document", "Document")
|
||||||
|
.WithOne("Scan")
|
||||||
|
.HasForeignKey("InternshipSystem.Core.DocumentScan", "DocumentId")
|
||||||
|
.HasConstraintName("fk_document_scan_document_document_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Course", "Course")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CourseId")
|
||||||
|
.HasConstraintName("fk_editions_courses_course_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("Internships")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_internships_editions_edition_id");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_internships_internship_registration_internship_registration");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ReportId")
|
||||||
|
.HasConstraintName("fk_internships_report_report_id");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("StudentId")
|
||||||
|
.HasConstraintName("fk_internships_students_student_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.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_types_type_id");
|
||||||
|
|
||||||
|
b.OwnsOne("InternshipSystem.Core.Mentor", "Mentor", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("InternshipRegistrationId")
|
||||||
|
.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.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnName("phone_number")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.HasKey("InternshipRegistrationId")
|
||||||
|
.HasName("pk_internship_registration");
|
||||||
|
|
||||||
|
b1.ToTable("internship_registration");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_mentor_internship_registration_internship_registration_id");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("AvailableInternshipTypes")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_edition_internship_type_editions_edition_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "InternshipType")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipTypeId")
|
||||||
|
.HasConstraintName("fk_edition_internship_type_internship_types_internship_type_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("AvailableSubjects")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_edition_subject_editions_edition_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipSubjectId")
|
||||||
|
.HasConstraintName("fk_edition_subject_internship_subject_internship_subject_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "Registration")
|
||||||
|
.WithMany("Subjects")
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_program_subject_internship_registration_internship_registrat")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipSubjectId")
|
||||||
|
.HasConstraintName("fk_program_subject_internship_subject_internship_subject_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,482 @@
|
|||||||
|
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),
|
||||||
|
nip = table.Column<string>(nullable: true),
|
||||||
|
name = table.Column<string>(nullable: true),
|
||||||
|
provider = table.Column<long>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_companies", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "courses",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<long>(nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
name = table.Column<string>(nullable: true),
|
||||||
|
name_eng = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_courses", 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),
|
||||||
|
description_eng = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_internship_subject", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "internship_types",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<long>(nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
label = table.Column<string>(nullable: true),
|
||||||
|
label_eng = table.Column<string>(nullable: true),
|
||||||
|
description = table.Column<string>(nullable: true),
|
||||||
|
description_eng = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_internship_types", 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),
|
||||||
|
range = table.Column<int>(nullable: false),
|
||||||
|
site_address = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_report", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "static_pages",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<long>(nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
access_name = table.Column<string>(nullable: true),
|
||||||
|
title = table.Column<string>(nullable: true),
|
||||||
|
title_eng = table.Column<string>(nullable: true),
|
||||||
|
content = table.Column<string>(nullable: true),
|
||||||
|
content_eng = table.Column<string>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_static_pages", x => x.id);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "students",
|
||||||
|
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),
|
||||||
|
course = table.Column<string>(nullable: true),
|
||||||
|
semester = table.Column<int>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_students", 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),
|
||||||
|
provider = table.Column<long>(nullable: false),
|
||||||
|
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<Guid>(nullable: false),
|
||||||
|
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_courses_course_id",
|
||||||
|
column: x => x.course_id,
|
||||||
|
principalTable: "courses",
|
||||||
|
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),
|
||||||
|
submission_date = table.Column<DateTime>(nullable: false),
|
||||||
|
start = table.Column<DateTime>(nullable: false),
|
||||||
|
end = table.Column<DateTime>(nullable: false),
|
||||||
|
first_name = table.Column<string>(nullable: true),
|
||||||
|
last_name = table.Column<string>(nullable: true),
|
||||||
|
email = table.Column<string>(nullable: true),
|
||||||
|
phone_number = table.Column<string>(nullable: true),
|
||||||
|
type_id = table.Column<long>(nullable: true),
|
||||||
|
declared_hours = table.Column<int>(nullable: false),
|
||||||
|
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_types_type_id",
|
||||||
|
column: x => x.type_id,
|
||||||
|
principalTable: "internship_types",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "edition_internship_type",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
edition_id = table.Column<Guid>(nullable: false),
|
||||||
|
internship_type_id = table.Column<long>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_edition_internship_type", x => new { x.edition_id, x.internship_type_id });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_edition_internship_type_editions_edition_id",
|
||||||
|
column: x => x.edition_id,
|
||||||
|
principalTable: "editions",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_edition_internship_type_internship_types_internship_type_id",
|
||||||
|
column: x => x.internship_type_id,
|
||||||
|
principalTable: "internship_types",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "edition_subject",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
edition_id = table.Column<Guid>(nullable: false),
|
||||||
|
internship_subject_id = table.Column<long>(nullable: false)
|
||||||
|
},
|
||||||
|
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_internship_subject_internship_subject_id",
|
||||||
|
column: x => x.internship_subject_id,
|
||||||
|
principalTable: "internship_subject",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "internships",
|
||||||
|
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),
|
||||||
|
report_id = table.Column<long>(nullable: true),
|
||||||
|
edition_id = table.Column<Guid>(nullable: true),
|
||||||
|
grade = table.Column<float>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_internships", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_internships_editions_edition_id",
|
||||||
|
column: x => x.edition_id,
|
||||||
|
principalTable: "editions",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_internships_internship_registration_internship_registration",
|
||||||
|
column: x => x.internship_registration_id,
|
||||||
|
principalTable: "internship_registration",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_internships_report_report_id",
|
||||||
|
column: x => x.report_id,
|
||||||
|
principalTable: "report",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_internships_students_student_id",
|
||||||
|
column: x => x.student_id,
|
||||||
|
principalTable: "students",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "program_subject",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
internship_registration_id = table.Column<long>(nullable: false),
|
||||||
|
internship_subject_id = table.Column<long>(nullable: false)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_program_subject", x => new { x.internship_registration_id, x.internship_subject_id });
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_program_subject_internship_registration_internship_registrat",
|
||||||
|
column: x => x.internship_registration_id,
|
||||||
|
principalTable: "internship_registration",
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "document",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
id = table.Column<long>(nullable: false)
|
||||||
|
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
|
||||||
|
description = table.Column<string>(nullable: true),
|
||||||
|
type = table.Column<int>(nullable: false),
|
||||||
|
state = table.Column<int>(nullable: false),
|
||||||
|
rejection_reason = table.Column<string>(nullable: true),
|
||||||
|
internship_id = table.Column<long>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_document", x => x.id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_document_internships_internship_id",
|
||||||
|
column: x => x.internship_id,
|
||||||
|
principalTable: "internships",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Restrict);
|
||||||
|
});
|
||||||
|
|
||||||
|
migrationBuilder.CreateTable(
|
||||||
|
name: "document_scan",
|
||||||
|
columns: table => new
|
||||||
|
{
|
||||||
|
document_id = table.Column<long>(nullable: false),
|
||||||
|
size = table.Column<long>(nullable: false),
|
||||||
|
filename = table.Column<string>(nullable: true),
|
||||||
|
mime = table.Column<string>(nullable: true),
|
||||||
|
file = table.Column<byte[]>(nullable: true)
|
||||||
|
},
|
||||||
|
constraints: table =>
|
||||||
|
{
|
||||||
|
table.PrimaryKey("pk_document_scan", x => x.document_id);
|
||||||
|
table.ForeignKey(
|
||||||
|
name: "fk_document_scan_document_document_id",
|
||||||
|
column: x => x.document_id,
|
||||||
|
principalTable: "document",
|
||||||
|
principalColumn: "id",
|
||||||
|
onDelete: ReferentialAction.Cascade);
|
||||||
|
});
|
||||||
|
|
||||||
|
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_internship_type_internship_type_id",
|
||||||
|
table: "edition_internship_type",
|
||||||
|
column: "internship_type_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_edition_subject_internship_subject_id",
|
||||||
|
table: "edition_subject",
|
||||||
|
column: "internship_subject_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_editions_course_id",
|
||||||
|
table: "editions",
|
||||||
|
column: "course_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_internships_edition_id",
|
||||||
|
table: "internships",
|
||||||
|
column: "edition_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internships_internship_registration_id",
|
||||||
|
table: "internships",
|
||||||
|
column: "internship_registration_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internships_report_id",
|
||||||
|
table: "internships",
|
||||||
|
column: "report_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_internships_student_id",
|
||||||
|
table: "internships",
|
||||||
|
column: "student_id");
|
||||||
|
|
||||||
|
migrationBuilder.CreateIndex(
|
||||||
|
name: "ix_program_subject_internship_subject_id",
|
||||||
|
table: "program_subject",
|
||||||
|
column: "internship_subject_id");
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
||||||
|
{
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "document_scan");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "edition_internship_type");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "edition_subject");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "program_subject");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "static_pages");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "document");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "internship_subject");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "internships");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "editions");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "internship_registration");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "report");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "students");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "courses");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "branch_office");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "internship_types");
|
||||||
|
|
||||||
|
migrationBuilder.DropTable(
|
||||||
|
name: "companies");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,700 @@
|
|||||||
|
// <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.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.Property<long>("Provider")
|
||||||
|
.HasColumnName("provider")
|
||||||
|
.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<string>("Nip")
|
||||||
|
.HasColumnName("nip")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("Provider")
|
||||||
|
.HasColumnName("provider")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_companies");
|
||||||
|
|
||||||
|
b.ToTable("companies");
|
||||||
|
});
|
||||||
|
|
||||||
|
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<string>("RejectionReason")
|
||||||
|
.HasColumnName("rejection_reason")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("State")
|
||||||
|
.HasColumnName("state")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<int>("Type")
|
||||||
|
.HasColumnName("type")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_document");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipId")
|
||||||
|
.HasName("ix_document_internship_id");
|
||||||
|
|
||||||
|
b.ToTable("document");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("DocumentId")
|
||||||
|
.HasColumnName("document_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<byte[]>("File")
|
||||||
|
.HasColumnName("file")
|
||||||
|
.HasColumnType("bytea");
|
||||||
|
|
||||||
|
b.Property<string>("Filename")
|
||||||
|
.HasColumnName("filename")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Mime")
|
||||||
|
.HasColumnName("mime")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<long>("Size")
|
||||||
|
.HasColumnName("size")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("DocumentId")
|
||||||
|
.HasName("pk_document_scan");
|
||||||
|
|
||||||
|
b.ToTable("document_scan");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
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.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.Property<string>("NameEng")
|
||||||
|
.HasColumnName("name_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_courses");
|
||||||
|
|
||||||
|
b.ToTable("courses");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<Guid?>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<float?>("Grade")
|
||||||
|
.HasColumnName("grade")
|
||||||
|
.HasColumnType("real");
|
||||||
|
|
||||||
|
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_internships");
|
||||||
|
|
||||||
|
b.HasIndex("EditionId")
|
||||||
|
.HasName("ix_internships_edition_id");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipRegistrationId")
|
||||||
|
.HasName("ix_internships_internship_registration_id");
|
||||||
|
|
||||||
|
b.HasIndex("ReportId")
|
||||||
|
.HasName("ix_internships_report_id");
|
||||||
|
|
||||||
|
b.HasIndex("StudentId")
|
||||||
|
.HasName("ix_internships_student_id");
|
||||||
|
|
||||||
|
b.ToTable("internships");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.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<int>("DeclaredHours")
|
||||||
|
.HasColumnName("declared_hours")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
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<DateTime>("SubmissionDate")
|
||||||
|
.HasColumnName("submission_date")
|
||||||
|
.HasColumnType("timestamp without time zone");
|
||||||
|
|
||||||
|
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.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.Property<string>("DescriptionEng")
|
||||||
|
.HasColumnName("description_eng")
|
||||||
|
.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>("DescriptionEng")
|
||||||
|
.HasColumnName("description_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Label")
|
||||||
|
.HasColumnName("label")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("LabelEng")
|
||||||
|
.HasColumnName("label_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_internship_types");
|
||||||
|
|
||||||
|
b.ToTable("internship_types");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Report", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<int>("Range")
|
||||||
|
.HasColumnName("range")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.Property<string>("SiteAddress")
|
||||||
|
.HasColumnName("site_address")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<int>("State")
|
||||||
|
.HasColumnName("state")
|
||||||
|
.HasColumnType("integer");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_report");
|
||||||
|
|
||||||
|
b.ToTable("report");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.StaticPage", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("Id")
|
||||||
|
.ValueGeneratedOnAdd()
|
||||||
|
.HasColumnName("id")
|
||||||
|
.HasColumnType("bigint")
|
||||||
|
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
|
||||||
|
|
||||||
|
b.Property<string>("AccessName")
|
||||||
|
.HasColumnName("access_name")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Content")
|
||||||
|
.HasColumnName("content")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("ContentEng")
|
||||||
|
.HasColumnName("content_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("Title")
|
||||||
|
.HasColumnName("title")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.Property<string>("TitleEng")
|
||||||
|
.HasColumnName("title_eng")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b.HasKey("Id")
|
||||||
|
.HasName("pk_static_pages");
|
||||||
|
|
||||||
|
b.ToTable("static_pages");
|
||||||
|
});
|
||||||
|
|
||||||
|
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>("Course")
|
||||||
|
.HasColumnName("course")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
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_students");
|
||||||
|
|
||||||
|
b.ToTable("students");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipTypeId")
|
||||||
|
.HasColumnName("internship_type_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("EditionId", "InternshipTypeId")
|
||||||
|
.HasName("pk_edition_internship_type");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipTypeId")
|
||||||
|
.HasName("ix_edition_internship_type_internship_type_id");
|
||||||
|
|
||||||
|
b.ToTable("edition_internship_type");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||||
|
{
|
||||||
|
b.Property<Guid>("EditionId")
|
||||||
|
.HasColumnName("edition_id")
|
||||||
|
.HasColumnType("uuid");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipSubjectId")
|
||||||
|
.HasColumnName("internship_subject_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("EditionId", "InternshipSubjectId")
|
||||||
|
.HasName("pk_edition_subject");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipSubjectId")
|
||||||
|
.HasName("ix_edition_subject_internship_subject_id");
|
||||||
|
|
||||||
|
b.ToTable("edition_subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||||
|
{
|
||||||
|
b.Property<long>("InternshipRegistrationId")
|
||||||
|
.HasColumnName("internship_registration_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.Property<long>("InternshipSubjectId")
|
||||||
|
.HasColumnName("internship_subject_id")
|
||||||
|
.HasColumnType("bigint");
|
||||||
|
|
||||||
|
b.HasKey("InternshipRegistrationId", "InternshipSubjectId")
|
||||||
|
.HasName("pk_program_subject");
|
||||||
|
|
||||||
|
b.HasIndex("InternshipSubjectId")
|
||||||
|
.HasName("ix_program_subject_internship_subject_id");
|
||||||
|
|
||||||
|
b.ToTable("program_subject");
|
||||||
|
});
|
||||||
|
|
||||||
|
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.Document", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.Internship", null)
|
||||||
|
.WithMany("Documentation")
|
||||||
|
.HasForeignKey("InternshipId")
|
||||||
|
.HasConstraintName("fk_document_internships_internship_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.DocumentScan", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Document", "Document")
|
||||||
|
.WithOne("Scan")
|
||||||
|
.HasForeignKey("InternshipSystem.Core.DocumentScan", "DocumentId")
|
||||||
|
.HasConstraintName("fk_document_scan_document_document_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Edition", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Course", "Course")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("CourseId")
|
||||||
|
.HasConstraintName("fk_editions_courses_course_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.Internship", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("Internships")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_internships_editions_edition_id");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "InternshipRegistration")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_internships_internship_registration_internship_registration");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Report", "Report")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("ReportId")
|
||||||
|
.HasConstraintName("fk_internships_report_report_id");
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Student", "Student")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("StudentId")
|
||||||
|
.HasConstraintName("fk_internships_students_student_id");
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.Entity.Internship.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_types_type_id");
|
||||||
|
|
||||||
|
b.OwnsOne("InternshipSystem.Core.Mentor", "Mentor", b1 =>
|
||||||
|
{
|
||||||
|
b1.Property<long>("InternshipRegistrationId")
|
||||||
|
.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.Property<string>("PhoneNumber")
|
||||||
|
.HasColumnName("phone_number")
|
||||||
|
.HasColumnType("text");
|
||||||
|
|
||||||
|
b1.HasKey("InternshipRegistrationId")
|
||||||
|
.HasName("pk_internship_registration");
|
||||||
|
|
||||||
|
b1.ToTable("internship_registration");
|
||||||
|
|
||||||
|
b1.WithOwner()
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_mentor_internship_registration_internship_registration_id");
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionInternshipType", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("AvailableInternshipTypes")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_edition_internship_type_editions_edition_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipType", "InternshipType")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipTypeId")
|
||||||
|
.HasConstraintName("fk_edition_internship_type_internship_types_internship_type_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.EditionSubject", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Edition", "Edition")
|
||||||
|
.WithMany("AvailableSubjects")
|
||||||
|
.HasForeignKey("EditionId")
|
||||||
|
.HasConstraintName("fk_edition_subject_editions_edition_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipSubjectId")
|
||||||
|
.HasConstraintName("fk_edition_subject_internship_subject_internship_subject_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
|
||||||
|
modelBuilder.Entity("InternshipSystem.Core.UglyOrmArtifacts.ProgramSubject", b =>
|
||||||
|
{
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipRegistration", "Registration")
|
||||||
|
.WithMany("Subjects")
|
||||||
|
.HasForeignKey("InternshipRegistrationId")
|
||||||
|
.HasConstraintName("fk_program_subject_internship_registration_internship_registrat")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
|
||||||
|
b.HasOne("InternshipSystem.Core.Entity.Internship.InternshipSubject", "Subject")
|
||||||
|
.WithMany()
|
||||||
|
.HasForeignKey("InternshipSubjectId")
|
||||||
|
.HasConstraintName("fk_program_subject_internship_subject_internship_subject_id")
|
||||||
|
.OnDelete(DeleteBehavior.Cascade)
|
||||||
|
.IsRequired();
|
||||||
|
});
|
||||||
|
#pragma warning restore 612, 618
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user