api สอบสวน
This commit is contained in:
parent
ab171a7394
commit
4882995f47
34 changed files with 36995 additions and 69 deletions
36
.github/workflows/release_discipline.yaml
vendored
36
.github/workflows/release_discipline.yaml
vendored
|
|
@ -67,21 +67,21 @@ jobs:
|
|||
docker-compose pull
|
||||
docker-compose up -d
|
||||
echo "${{ steps.gen_ver.outputs.image_ver }}"> success
|
||||
# - uses: snow-actions/line-notify@v1.1.0
|
||||
# if: success()
|
||||
# with:
|
||||
# access_token: ${{ env.TOKEN_LINE }}
|
||||
# message: |
|
||||
# -Success✅✅✅
|
||||
# Image: ${{env.IMAGE_NAME}}
|
||||
# Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
# By: ${{secrets.DOCKER_USER}}
|
||||
# - uses: snow-actions/line-notify@v1.1.0
|
||||
# if: failure()
|
||||
# with:
|
||||
# access_token: ${{ env.TOKEN_LINE }}
|
||||
# message: |
|
||||
# -Failure❌❌❌
|
||||
# Image: ${{env.IMAGE_NAME}}
|
||||
# Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
# By: ${{secrets.DOCKER_USER}}
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
if: success()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Success✅✅✅
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
- uses: snow-actions/line-notify@v1.1.0
|
||||
if: failure()
|
||||
with:
|
||||
access_token: ${{ env.TOKEN_LINE }}
|
||||
message: |
|
||||
-Failure❌❌❌
|
||||
Image: ${{env.IMAGE_NAME}}
|
||||
Version: ${{ github.event.inputs.IMAGE_VER }}
|
||||
By: ${{secrets.DOCKER_USER}}
|
||||
|
|
|
|||
|
|
@ -70,6 +70,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
CreatedAt = x.CreatedAt,//วันที่สร้างเรื่องร้องเรียน
|
||||
LevelConsideration = x.LevelConsideration,//ระดับการพิจารณา
|
||||
DateConsideration = x.DateConsideration,//วันที่กำหนดพิจารณา
|
||||
DateReceived = x.DateReceived,//วันที่รับเรื่อง
|
||||
Status = x.Status,//สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)
|
||||
Result = x.Result,
|
||||
})
|
||||
|
|
@ -393,8 +394,8 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
var persons = data.DisciplineComplaint_Profiles.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
disciplineInvestigate.DisciplineInvestigate_Profiles.Add(
|
||||
new DisciplineInvestigate_Profile
|
||||
disciplineInvestigate.DisciplineInvestigate_ProfileComplaints.Add(
|
||||
new DisciplineInvestigate_ProfileComplaint
|
||||
{
|
||||
PersonId = item.PersonId,
|
||||
CitizenId = item.CitizenId,
|
||||
|
|
@ -507,7 +508,7 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบอัพไฟล์เอกสารร้องเรียนวินัย
|
||||
/// ลบไฟล์เอกสารร้องเรียนวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -533,8 +534,12 @@ namespace BMA.EHR.DisciplineComplaint.Service.Controllers
|
|||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -57,21 +57,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
{
|
||||
var data_search = (from x in _context.DisciplineInvestigates
|
||||
where x.Title.Contains(keyword)
|
||||
// x.Description.Contains(keyword) ||
|
||||
// x.Appellant.Contains(keyword)
|
||||
// TextOffenseDetails(x.OffenseDetails).Contains(keyword) ||
|
||||
// x.CreatedAt.Contains(keyword) ||
|
||||
// TextLevelConsideration(x.LevelConsideration).Contains(keyword) ||
|
||||
// x.DateConsideration.Contains(keyword) ||
|
||||
// TextStatus(x.Status).Contains(keyword) ||
|
||||
// x.RejectReason == null ? false : x.RejectReason.Contains(keyword)
|
||||
select x).ToList();
|
||||
var data = data_search
|
||||
.Select(x => new
|
||||
{
|
||||
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
Title = x.Title,//ชื่อเรื่อง
|
||||
RespondentType = x.RespondentType,
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
OffenseDetails = x.OffenseDetails,//ลักษณะความผิด
|
||||
Status = x.Status,//สถานะหรือผลการสืบสวน
|
||||
InvestigationDateStart = x.InvestigationDateStart,
|
||||
|
|
@ -104,7 +96,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
Id = x.Id,//id ข้อมูลเรื่องสืบสวน
|
||||
IdComplaint = x.DisciplineComplaint.Id,//id ข้อมูลเรื่องร้องเรียน
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineInvestigate_Profiles.Select(p => new
|
||||
Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new
|
||||
{
|
||||
Id = p.Id,
|
||||
Idcard = p.CitizenId,
|
||||
|
|
@ -183,9 +175,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpPut("complaint/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> UpdateDisciplineInvestigate([FromBody] DisciplineInvestigateComplaintRequest req, Guid id)
|
||||
public async Task<ActionResult<ResponseObject>> UpdateDisciplineInvestigateComplaint([FromBody] DisciplineInvestigateComplaintRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_Profiles).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
var data = await _context.DisciplineInvestigates.Include(x => x.DisciplineInvestigate_ProfileComplaints).Where(x => x.Id == id).FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
|
|
@ -197,13 +189,13 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
data.LastUpdatedAt = DateTime.Now;
|
||||
_context.DisciplineInvestigate_Profiles.RemoveRange(data.DisciplineInvestigate_Profiles);
|
||||
_context.DisciplineInvestigate_ProfileComplaints.RemoveRange(data.DisciplineInvestigate_ProfileComplaints);
|
||||
if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
{
|
||||
foreach (var item in req.persons)
|
||||
{
|
||||
data.DisciplineInvestigate_Profiles.Add(
|
||||
new DisciplineInvestigate_Profile
|
||||
data.DisciplineInvestigate_ProfileComplaints.Add(
|
||||
new DisciplineInvestigate_ProfileComplaint
|
||||
{
|
||||
CitizenId = item.idcard,
|
||||
Prefix = item.prefix,
|
||||
|
|
@ -267,6 +259,23 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
Phone = d.DisciplineDirector.Phone,
|
||||
Total = d.DisciplineDirector.DisciplineInvestigate_Directors.Count(),
|
||||
}).ToList(),
|
||||
RespondentType = x.RespondentType,//ผู้ถูกสืบสวน
|
||||
Persons = x.DisciplineInvestigate_ProfileComplaints.Select(p => new
|
||||
{
|
||||
Id = p.Id,
|
||||
Idcard = p.CitizenId,
|
||||
Name = $"{p.Prefix}{p.FirstName} {p.LastName}",
|
||||
Prefix = p.Prefix,
|
||||
FirstName = p.FirstName,
|
||||
LastName = p.LastName,
|
||||
Position = p.Position,
|
||||
PositionLevel = p.PositionLevel,
|
||||
Salary = p.Salary,
|
||||
PersonId = p.PersonId,
|
||||
PosNo = p.PosNo,
|
||||
Organization = p.Organization,
|
||||
}),//รายการข้อมูลบุคลผู้ถูกสืบสวน
|
||||
OrganizationId = x.Organization,//id หน่วยงานกรณี type เป็นหน่วยงาน
|
||||
DisciplineInvestigateDocs = x.DisciplineInvestigate_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
DisciplineInvestigateRelevantDocs = x.DisciplineInvestigateRelevant_Docs.Where(d => d.Document != null).Select(d => new { d.Document.Id, d.Document.FileName }),
|
||||
})
|
||||
|
|
@ -312,6 +321,9 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
_data.Status,
|
||||
_data.Result,
|
||||
_data.Director,
|
||||
_data.RespondentType,
|
||||
_data.Persons,
|
||||
_data.OrganizationId,
|
||||
disciplineInvestigateDocs,
|
||||
disciplineInvestigateRelevantDocs,
|
||||
};
|
||||
|
|
@ -345,7 +357,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
data.InvestigationDateEnd = req.investigationDateEnd;
|
||||
data.InvestigationDescription = req.investigationDescription;
|
||||
data.InvestigationStatusResult = req.investigationStatusResult.Trim().ToUpper();
|
||||
data.InvestigationCauseText = req.investigationCauseText.Trim().ToUpper();
|
||||
data.InvestigationCauseText = req.investigationCauseText;
|
||||
data.Result = req.result;
|
||||
data.LastUpdateFullName = FullName ?? "System Administrator";
|
||||
data.LastUpdateUserId = UserId ?? "";
|
||||
|
|
@ -371,6 +383,36 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
);
|
||||
}
|
||||
}
|
||||
data.Organization = req.organizationId;
|
||||
data.RespondentType = req.respondentType;
|
||||
_context.DisciplineInvestigate_ProfileComplaints.RemoveRange(data.DisciplineInvestigate_ProfileComplaints);
|
||||
if (data.RespondentType.Trim().ToUpper() == "PERSON")
|
||||
{
|
||||
foreach (var item in req.persons)
|
||||
{
|
||||
data.DisciplineInvestigate_ProfileComplaints.Add(
|
||||
new DisciplineInvestigate_ProfileComplaint
|
||||
{
|
||||
CitizenId = item.idcard,
|
||||
Prefix = item.prefix,
|
||||
FirstName = item.firstName,
|
||||
LastName = item.lastName,
|
||||
Organization = item.organization,
|
||||
Position = item.position,
|
||||
PositionLevel = item.positionLevel,
|
||||
Salary = item.salary,
|
||||
PersonId = item.personId,
|
||||
PosNo = item.posNo,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(data.Id);
|
||||
}
|
||||
|
|
@ -409,17 +451,144 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
|
||||
/// <response code="401">ไม่ได้ Login เข้าระบบ</response>
|
||||
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
|
||||
[HttpGet("approve/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveDisciplineInvestigate(Guid id)
|
||||
[HttpPut("approve/{id:guid}")]
|
||||
public async Task<ActionResult<ResponseObject>> ApproveDisciplineInvestigate([FromBody] DisciplinePersonIdRequest req, Guid id)
|
||||
{
|
||||
var data = await _context.DisciplineInvestigates
|
||||
.Include(x => x.DisciplineInvestigate_DocComplaints)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.DisciplineInvestigate_Docs)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.DisciplineInvestigateRelevant_Docs)
|
||||
.ThenInclude(x => x.Document)
|
||||
.Include(x => x.DisciplineInvestigate_ProfileComplaints)
|
||||
.Include(x => x.DisciplineInvestigate_Directors)
|
||||
.ThenInclude(x => x.DisciplineDirector)
|
||||
.Where(x => x.Id == id)
|
||||
.FirstOrDefaultAsync();
|
||||
if (data == null)
|
||||
return Error(new Exception(GlobalMessages.DataNotFound), (int)StatusCodes.Status404NotFound);
|
||||
if (data.Status.Trim().ToUpper() != "NEW")
|
||||
return Error(new Exception("ไม่สามารถส่งต่อไปสืบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "SEND_INVESTIGATE";
|
||||
return Error(new Exception("ไม่สามารถส่งต่อไปสอบสวนได้"), (int)StatusCodes.Status500InternalServerError);
|
||||
data.Status = "SEND_DISCIPLINARY";
|
||||
|
||||
var disciplineDisciplinary = new Domain.Models.Discipline.DisciplineDisciplinary
|
||||
{
|
||||
RespondentType = data.RespondentType.Trim().ToUpper(),
|
||||
Organization = data.Organization,
|
||||
ConsideredAgency = data.ConsideredAgency,
|
||||
Title = data.Title,
|
||||
Description = data.Description,
|
||||
DateReceived = data.DateReceived,
|
||||
LevelConsideration = data.LevelConsideration.Trim().ToUpper(),
|
||||
DateConsideration = data.DateConsideration,
|
||||
OffenseDetails = data.OffenseDetails.Trim().ToUpper(),
|
||||
DateNotification = data.DateNotification,
|
||||
ComplaintFrom = data.ComplaintFrom,
|
||||
Appellant = data.Appellant,
|
||||
ResultComplaint = data.ResultComplaint,
|
||||
ResultInvestigate = data.Result,
|
||||
|
||||
InvestigationDetail = data.InvestigationDetail,
|
||||
InvestigationDetailOther = data.InvestigationDetailOther,
|
||||
InvestigationDateStart = data.InvestigationDateStart,
|
||||
InvestigationDateEnd = data.InvestigationDateEnd,
|
||||
InvestigationDescription = data.InvestigationDescription,
|
||||
InvestigationStatusResult = data.InvestigationStatusResult,
|
||||
InvestigationCauseText = data.InvestigationCauseText,
|
||||
|
||||
Status = "NEW",
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
};
|
||||
var persons = data.DisciplineInvestigate_ProfileComplaints.Where(x => req.persons.Contains(x.Id)).ToList();
|
||||
foreach (var item in persons)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_ProfileComplaintInvestigates.Add(
|
||||
new DisciplineDisciplinary_ProfileComplaintInvestigate
|
||||
{
|
||||
PersonId = item.PersonId,
|
||||
CitizenId = item.CitizenId,
|
||||
Prefix = item.Prefix,
|
||||
FirstName = item.FirstName,
|
||||
LastName = item.LastName,
|
||||
Organization = item.Organization,
|
||||
Salary = item.Salary,
|
||||
PosNo = item.PosNo,
|
||||
Position = item.Position,
|
||||
PositionLevel = item.PositionLevel,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineInvestigate_DocComplaints)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_DocComplaintInvestigates.Add(
|
||||
new DisciplineDisciplinary_DocComplaintInvestigate
|
||||
{
|
||||
Document = item.Document,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineInvestigate_Docs)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_DocInvestigates.Add(
|
||||
new DisciplineDisciplinary_DocInvestigate
|
||||
{
|
||||
Document = item.Document,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineInvestigateRelevant_Docs)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_DocInvestigateRelevants.Add(
|
||||
new DisciplineDisciplinary_DocInvestigateRelevant
|
||||
{
|
||||
Document = item.Document,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
foreach (var item in data.DisciplineInvestigate_Directors)
|
||||
{
|
||||
disciplineDisciplinary.DisciplineDisciplinary_DirectorInvestigates.Add(
|
||||
new DisciplineDisciplinary_DirectorInvestigate
|
||||
{
|
||||
DisciplineDirector = item.DisciplineDirector,
|
||||
CreatedFullName = FullName ?? "System Administrator",
|
||||
CreatedUserId = UserId ?? "",
|
||||
CreatedAt = DateTime.Now,
|
||||
LastUpdateFullName = FullName ?? "System Administrator",
|
||||
LastUpdateUserId = UserId ?? "",
|
||||
LastUpdatedAt = DateTime.Now,
|
||||
});
|
||||
}
|
||||
|
||||
data.DisciplineDisciplinarys.Add(disciplineDisciplinary);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success(disciplineDisciplinary.Id);
|
||||
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
|
|
@ -498,7 +667,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบอัพไฟล์เอกสารสืบสวนวินัย
|
||||
/// ลบไฟล์เอกสารสืบสวนวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -524,8 +693,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -577,7 +750,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบอัพไฟล์เอกสารร้องเรียนวินัย
|
||||
/// ลบไฟล์เอกสารร้องเรียนวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -610,8 +783,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
@ -663,7 +840,7 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// ลบอัพไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย
|
||||
/// ลบไฟล์เอกสารเกี่ยวข้องสืบสวนวินัย
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
/// <response code="200"></response>
|
||||
|
|
@ -689,8 +866,12 @@ namespace BMA.EHR.DisciplineInvestigate.Service.Controllers
|
|||
await _context.SaveChangesAsync();
|
||||
await _documentService.DeleteFileAsync(docId);
|
||||
await _context.SaveChangesAsync();
|
||||
return Success();
|
||||
}
|
||||
else
|
||||
{
|
||||
return Error(new Exception("ไม่พอไฟล์นี้ในระบบ"), (int)StatusCodes.Status404NotFound);
|
||||
}
|
||||
return Success();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,25 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineDisciplinaryComplaintRequest
|
||||
{
|
||||
public DisciplineDisciplinaryInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public string title { get; set; }// *เรื่องที่ร้องเรียน
|
||||
public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน
|
||||
public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)
|
||||
}
|
||||
public class DisciplineDisciplinaryInvestigateComplaintProfileRequest
|
||||
{
|
||||
public Guid? personId { get; set; }
|
||||
public string? idcard { get; set; }
|
||||
public string? prefix { get; set; }
|
||||
public string? firstName { get; set; }
|
||||
public string? lastName { get; set; }
|
||||
public string? organization { get; set; }
|
||||
public string? position { get; set; }
|
||||
public string? positionLevel { get; set; }
|
||||
public string? posNo { get; set; }
|
||||
public double? salary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineDisciplinaryInvestigateRequest
|
||||
{
|
||||
public string investigationDetail { get; set; }
|
||||
public string? investigationDetailOther { get; set; }
|
||||
public DateTime investigationDateStart { get; set; }
|
||||
public DateTime investigationDateEnd { get; set; }
|
||||
public string investigationDescription { get; set; }
|
||||
public string investigationStatusResult { get; set; }
|
||||
public string? investigationCauseText { get; set; }
|
||||
public string? result { get; set; }
|
||||
public Guid[] directors { get; set; }
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Discipline.Service.Requests
|
||||
{
|
||||
public class DisciplineDisciplinaryRequest
|
||||
{
|
||||
public string? DisciplinaryWitnesses { get; set; }
|
||||
public string? DisciplinaryRecordAccuser { get; set; }
|
||||
public string? DisciplinarySummaryEvidence { get; set; }
|
||||
public string? DisciplinaryRefLaw { get; set; }
|
||||
public string? DisciplinaryFaultLevel { get; set; }
|
||||
public string? DisciplinaryInvestigateAt { get; set; }
|
||||
public string? DisciplinaryCaseFault { get; set; }
|
||||
public DateTime DisciplinaryDateEvident { get; set; }
|
||||
public DateTime DisciplinaryDateAllegation { get; set; }
|
||||
public string? Result { get; set; }
|
||||
public Guid[] directors { get; set; }
|
||||
public DisciplineDisciplinaryInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public Guid? organizationId { get; set; }// กรณีหน่วยงานใส่ id ของหน่วยงาน
|
||||
public string respondentType { get; set; }// *ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -4,7 +4,7 @@ namespace BMA.EHR.Discipline.Service.Requests
|
|||
{
|
||||
public class DisciplineInvestigateComplaintRequest
|
||||
{
|
||||
public DisciplineComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public DisciplineInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public string title { get; set; }// *เรื่องที่ร้องเรียน
|
||||
public string description { get; set; }// *รายละเอียดของเรื่องร้องเรียน
|
||||
public string offenseDetails { get; set; }// *ลักษณะความผิดครั้งแรกจะเป็น "ยังไม่ระบุ" (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)
|
||||
|
|
|
|||
|
|
@ -5,14 +5,17 @@ namespace BMA.EHR.Discipline.Service.Requests
|
|||
public class DisciplineInvestigateRequest
|
||||
{
|
||||
public string investigationDetail { get; set; }
|
||||
public string investigationDetailOther { get; set; }
|
||||
public string? investigationDetailOther { get; set; }
|
||||
public DateTime investigationDateStart { get; set; }
|
||||
public DateTime investigationDateEnd { get; set; }
|
||||
public string investigationDescription { get; set; }
|
||||
public string investigationStatusResult { get; set; }
|
||||
public string investigationCauseText { get; set; }
|
||||
public string result { get; set; }
|
||||
public string? investigationCauseText { get; set; }
|
||||
public string? result { get; set; }
|
||||
public Guid[] directors { get; set; }
|
||||
public DisciplineInvestigateComplaintProfileRequest[] persons { get; set; }// กรณีบุคคลใส่ id คน มาใน array แต่ถ้าเป็น type อื่นจะ null
|
||||
public Guid? organizationId { get; set; }// กรณีหน่วยงานใส่ id ของหน่วยงาน
|
||||
public string respondentType { get; set; }// *ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -25,5 +25,6 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
[Required, Comment("เบอร์โทรศัพท์")]
|
||||
public string Phone { get; set; } = string.Empty;
|
||||
public virtual List<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; } = new List<DisciplineInvestigate_Director>();
|
||||
public virtual List<DisciplineDisciplinary_DirectorInvestigate> DisciplineDisciplinary_DirectorInvestigates { get; set; } = new List<DisciplineDisciplinary_DirectorInvestigate>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
113
BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs
Normal file
113
BMA.EHR.Domain/Models/Discipline/DisciplineDisciplinary.cs
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary : EntityBase
|
||||
{
|
||||
|
||||
[Required, Comment("สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")]
|
||||
public string Status { get; set; } = string.Empty;
|
||||
[Required, Comment("ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")]
|
||||
public string RespondentType { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("เรื่องที่ร้องเรียน"), Column(TypeName = "text")]
|
||||
public string Title { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("รายละเอียดของเรื่องร้องเรียน"), Column(TypeName = "text")]
|
||||
public string Description { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ")]
|
||||
public DateTime DateReceived { get; set; }
|
||||
[Required, Comment("ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")]
|
||||
public string LevelConsideration { get; set; } = string.Empty;
|
||||
|
||||
[Comment("วันที่กำหนดพิจารณา")]
|
||||
public DateTime? DateConsideration { get; set; }
|
||||
[Required, Comment("ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")]
|
||||
public string OffenseDetails { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("วันแจ้งเตือนล่วงหน้า")]
|
||||
public DateTime DateNotification { get; set; }
|
||||
[Required, Comment("รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")]
|
||||
public string ComplaintFrom { get; set; } = string.Empty;
|
||||
|
||||
[Required, Comment("ผู้ร้องเรียน")]
|
||||
public string Appellant { get; set; } = string.Empty;
|
||||
|
||||
// [Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
// public Document Document { get; set; }
|
||||
|
||||
[Comment("ผลการตรวจสอบเรื่องร้องเรียน")]
|
||||
public string? ResultComplaint { get; set; }
|
||||
|
||||
[Comment("ผลการตรวจสอบเรื่องสืบสวน")]
|
||||
public string? ResultInvestigate { get; set; }
|
||||
|
||||
[Comment("ผลการตรวจสอบ")]
|
||||
public string? Result { get; set; }
|
||||
|
||||
[Comment("กรณีหน่วยงานใส่ id ของหน่วยงาน")]
|
||||
public Guid? Organization { get; set; }
|
||||
|
||||
[Required, Comment("หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง")]
|
||||
public Guid ConsideredAgency { get; set; }
|
||||
|
||||
|
||||
[Comment("ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)")]
|
||||
public string? InvestigationDetail { get; set; }
|
||||
|
||||
[Comment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ")]
|
||||
public string? InvestigationDetailOther { get; set; }
|
||||
|
||||
[Comment("วันที่เริ่มการสืบสวน")]
|
||||
public DateTime? InvestigationDateStart { get; set; }
|
||||
|
||||
[Comment("วันที่สิ้นสุดการสืบสวน")]
|
||||
public DateTime? InvestigationDateEnd { get; set; }
|
||||
|
||||
[Comment("รายละเอียดเกี่ยวกับการสืบสวน")]
|
||||
public string? InvestigationDescription { get; set; }
|
||||
|
||||
[Comment("สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล")]
|
||||
public string? InvestigationStatusResult { get; set; }
|
||||
|
||||
[Comment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")]
|
||||
public string? InvestigationCauseText { get; set; }
|
||||
|
||||
|
||||
[Comment("พยานและบันทึกถ้อยคำพยาน")]
|
||||
public string? DisciplinaryWitnesses { get; set; }
|
||||
[Comment("บันทึกถ้อยคำของผู้กล่าวหา")]
|
||||
public string? DisciplinaryRecordAccuser { get; set; }
|
||||
[Comment("สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา")]
|
||||
public string? DisciplinarySummaryEvidence { get; set; }
|
||||
[Comment("อ้างอิงมาตราตามกฎหมาย")]
|
||||
public string? DisciplinaryRefLaw { get; set; }
|
||||
[Comment("ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก")]
|
||||
public string? DisciplinaryFaultLevel { get; set; }
|
||||
[Comment("สอบสวนที่")]
|
||||
public string? DisciplinaryInvestigateAt { get; set; }
|
||||
[Comment("กรณีความผิด")]
|
||||
public string? DisciplinaryCaseFault { get; set; }
|
||||
[Comment("วันที่สรุปพยานหลักฐาน")]
|
||||
public DateTime? DisciplinaryDateEvident { get; set; }
|
||||
[Comment("วันที่รับทราบข้อกล่าวหา")]
|
||||
public DateTime? DisciplinaryDateAllegation { get; set; }
|
||||
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
public virtual List<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; } = new List<DisciplineDisciplinary_ProfileComplaintInvestigate>();
|
||||
public virtual List<DisciplineDisciplinary_DocComplaintInvestigate> DisciplineDisciplinary_DocComplaintInvestigates { get; set; } = new List<DisciplineDisciplinary_DocComplaintInvestigate>();
|
||||
public virtual List<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; } = new List<DisciplineDisciplinary_DocInvestigate>();
|
||||
public virtual List<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; } = new List<DisciplineDisciplinary_DocInvestigateRelevant>();
|
||||
public virtual List<DisciplineDisciplinary_DirectorInvestigate> DisciplineDisciplinary_DirectorInvestigates { get; set; } = new List<DisciplineDisciplinary_DirectorInvestigate>();
|
||||
|
||||
public virtual List<DisciplineDisciplinary_DocSummaryEvidence> DisciplineDisciplinary_DocSummaryEvidences { get; set; } = new List<DisciplineDisciplinary_DocSummaryEvidence>();
|
||||
public virtual List<DisciplineDisciplinary_DocRecordAccuser> DisciplineDisciplinary_DocRecordAccusers { get; set; } = new List<DisciplineDisciplinary_DocRecordAccuser>();
|
||||
public virtual List<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; } = new List<DisciplineDisciplinary_DocWitnesses>();
|
||||
public virtual List<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; } = new List<DisciplineDisciplinary_DocOther>();
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DirectorInvestigate : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสกรรมการ")]
|
||||
public DisciplineDirector DisciplineDirector { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocComplaintInvestigate : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocInvestigate : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocInvestigateRelevant : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocOther : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocRecordAccuser : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocSummaryEvidence : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_DocWitnesses : EntityBase
|
||||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System.ComponentModel.DataAnnotations.Schema;
|
||||
using BMA.EHR.Domain.Models.Base;
|
||||
using BMA.EHR.Domain.Models.MetaData;
|
||||
using BMA.EHR.Domain.Models.Organizations;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineDisciplinary_ProfileComplaintInvestigate : EntityBase
|
||||
{
|
||||
[Comment("id อ้างอิง profile")]
|
||||
public Guid? PersonId { get; set; }
|
||||
[MaxLength(13), Comment("รหัสบัตรประชาชน")]
|
||||
public string? CitizenId { get; set; }
|
||||
[Comment("คำนำหน้า")]
|
||||
public string? Prefix { get; set; }
|
||||
[Required, MaxLength(100), Comment("ชื่อ")]
|
||||
public string? FirstName { get; set; }
|
||||
[Required, MaxLength(100), Comment("นามสกุล")]
|
||||
public string? LastName { get; set; }
|
||||
[Comment("สังกัด")]
|
||||
public string? Organization { get; set; }
|
||||
[Comment("ตำแหน่ง")]
|
||||
public string? Position { get; set; }
|
||||
[Comment("เลขที่ตำแหน่ง")]
|
||||
public string? PosNo { get; set; }
|
||||
[Comment("ระดับ")]
|
||||
public string? PositionLevel { get; set; }
|
||||
[Comment("เงินเดือน")]
|
||||
public double? Salary { get; set; }
|
||||
[Required, Comment("Id เรื่องสอบสวน")]
|
||||
public DisciplineDisciplinary DisciplineDisciplinary { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -60,10 +60,10 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
[Comment("ลักษณะการสืบสวนกรณีเลือกอื่นๆ")]
|
||||
public string? InvestigationDetailOther { get; set; }
|
||||
|
||||
[Comment("วันที่เริ่มการสอบสวน")]
|
||||
[Comment("วันที่เริ่มการสืบสวน")]
|
||||
public DateTime? InvestigationDateStart { get; set; }
|
||||
|
||||
[Comment("วันที่สิ้นสุดการสอบสวน")]
|
||||
[Comment("วันที่สิ้นสุดการสืบสวน")]
|
||||
public DateTime? InvestigationDateEnd { get; set; }
|
||||
|
||||
[Comment("รายละเอียดเกี่ยวกับการสืบสวน")]
|
||||
|
|
@ -75,10 +75,11 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
[Comment("กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")]
|
||||
public string? InvestigationCauseText { get; set; }
|
||||
public DisciplineComplaint DisciplineComplaint { get; set; }
|
||||
public virtual List<DisciplineInvestigate_Profile> DisciplineInvestigate_Profiles { get; set; } = new List<DisciplineInvestigate_Profile>();
|
||||
public virtual List<DisciplineInvestigate_ProfileComplaint> DisciplineInvestigate_ProfileComplaints { get; set; } = new List<DisciplineInvestigate_ProfileComplaint>();
|
||||
public virtual List<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; } = new List<DisciplineInvestigate_DocComplaint>();
|
||||
public virtual List<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; } = new List<DisciplineInvestigate_Doc>();
|
||||
public virtual List<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; } = new List<DisciplineInvestigateRelevant_Doc>();
|
||||
public virtual List<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; } = new List<DisciplineInvestigate_Director>();
|
||||
public virtual List<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; } = new List<DisciplineDisciplinary>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
[Required, Comment("อ้างอิงเรื่องสืบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
{
|
||||
[Required, Comment("อ้างอิงรหัสกรรมการ")]
|
||||
public DisciplineDirector DisciplineDirector { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องร้องเรียน")]
|
||||
[Required, Comment("อ้างอิงเรื่องสืบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องสอบสวน")]
|
||||
[Required, Comment("อ้างอิงเรื่องสืบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
{
|
||||
[Required, Comment("อ้างอิงรหัสเอกสาร")]
|
||||
public Document Document { get; set; }
|
||||
[Required, Comment("อ้างอิงเรื่องร้องเรียน")]
|
||||
[Required, Comment("อ้างอิงเรื่องสืบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ using Microsoft.EntityFrameworkCore;
|
|||
|
||||
namespace BMA.EHR.Domain.Models.Discipline
|
||||
{
|
||||
public class DisciplineInvestigate_Profile : EntityBase
|
||||
public class DisciplineInvestigate_ProfileComplaint : EntityBase
|
||||
{
|
||||
[Comment("id อ้างอิง profile")]
|
||||
public Guid? PersonId { get; set; }
|
||||
|
|
@ -29,7 +29,7 @@ namespace BMA.EHR.Domain.Models.Discipline
|
|||
public string? PositionLevel { get; set; }
|
||||
[Comment("เงินเดือน")]
|
||||
public double? Salary { get; set; }
|
||||
[Required, Comment("Id เรื่องร้องเรียน")]
|
||||
[Required, Comment("Id เรื่องสืบสวน")]
|
||||
public DisciplineInvestigate DisciplineInvestigate { get; set; }
|
||||
}
|
||||
}
|
||||
10654
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.Designer.cs
generated
Normal file
10654
BMA.EHR.Infrastructure/Migrations/DisciplineDb/20231123133022_add table DisciplineDisciplinary.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,589 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableDisciplineDisciplinary : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_Profiles");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisciplineDirectorId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DirectorInvestigates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~",
|
||||
column: x => x.DisciplineDirectorId,
|
||||
principalTable: "DisciplineDirectors",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocComplaintInvestigates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_Documents_Do~",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigateRelevants", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_Documents_Doc~",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocInvestigates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocInvestigates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
|
||||
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_ProfileComplaintInvestigates", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinarys",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Status = table.Column<string>(type: "longtext", nullable: false, comment: "สถานะเรื่องร้องเรียน มีดังนี้ ใหม่ (NEW), ยุติเรื่อง (STOP), มีมูลส่งไปสืบสวนแล้ว (SEND_INVESTIGATE)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
RespondentType = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ถูกร้องเรียน (PERSON คือ บุคคล, ORGANIZATION คือ หน่วยงาน, BANGKOK คือ กรุงเทพมหานคร)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Title = table.Column<string>(type: "text", nullable: false, comment: "เรื่องที่ร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Description = table.Column<string>(type: "text", nullable: false, comment: "รายละเอียดของเรื่องร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateReceived = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันที่รับเรื่อง เป็นวันที่ถือเป็นจุดเริ่มต้นของวินัยนั้น ๆ"),
|
||||
LevelConsideration = table.Column<string>(type: "longtext", nullable: false, comment: "ระดับการพิจารณา 'ยังไม่ระบุ' (NORMAL คือ ปกติ, URGENT คือ ด่วน, VERY_URGENT คือ ด่วนมาก)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateConsideration = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่กำหนดพิจารณา"),
|
||||
OffenseDetails = table.Column<string>(type: "longtext", nullable: false, comment: "ลักษณะความผิดครั้งแรกจะเป็น 'ยังไม่ระบุ' (NOT_SPECIFIED คือ ยังไม่ระบุ, NOT_DEADLY คือ ไม่ร้ายแรง, DEADLY คือ ร้ายแรง)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DateNotification = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "วันแจ้งเตือนล่วงหน้า"),
|
||||
ComplaintFrom = table.Column<string>(type: "longtext", nullable: false, comment: "รับเรื่องร้องเรียนจาก ระบุว่ารับเรื่องมาจากใคร/หน่วยงานไหน (สตง., ปปช., ปปท., จดหมาย, อีเมล, โทรศัพท์, บอกกล่าว)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Appellant = table.Column<string>(type: "longtext", nullable: false, comment: "ผู้ร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
ResultComplaint = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบเรื่องร้องเรียน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Result = table.Column<string>(type: "longtext", nullable: true, comment: "ผลการตรวจสอบ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<Guid>(type: "char(36)", nullable: true, comment: "กรณีหน่วยงานใส่ id ของหน่วยงาน", collation: "ascii_general_ci"),
|
||||
ConsideredAgency = table.Column<Guid>(type: "char(36)", nullable: false, comment: "หน่วยงานที่พิจารณา จะเปลี่ยนไปตามผู้ถูกร้องดูรายละเอียดด้านล่าง", collation: "ascii_general_ci"),
|
||||
InvestigationDetail = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationDetailOther = table.Column<string>(type: "longtext", nullable: true, comment: "ลักษณะการสืบสวนกรณีเลือกอื่นๆ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationDateStart = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่เริ่มการสอบสวน"),
|
||||
InvestigationDateEnd = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "วันที่สิ้นสุดการสอบสวน"),
|
||||
InvestigationDescription = table.Column<string>(type: "longtext", nullable: true, comment: "รายละเอียดเกี่ยวกับการสืบสวน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationStatusResult = table.Column<string>(type: "longtext", nullable: true, comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
InvestigationCauseText = table.Column<string>(type: "longtext", nullable: true, comment: "กรณีมีมูลต้องเลือกว่า 'ร้ายแรง' หรือ 'ไม่ร้ายแรง'")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisciplineComplaintId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinarys", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
|
||||
column: x => x.DisciplineComplaintId,
|
||||
principalTable: "DisciplineComplaints",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_ProfileComplaints",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
|
||||
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: true, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_ProfileComplaints", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDirect~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
column: "DisciplineDirectorId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigates_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinarys_DisciplineComplaintId",
|
||||
table: "DisciplineDisciplinarys",
|
||||
column: "DisciplineComplaintId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineInvestigat~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints",
|
||||
column: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DirectorInvestigates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocInvestigateRelevants");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocInvestigates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineInvestigate_ProfileComplaints");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineInvestigate_Profiles",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DisciplineInvestigateId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
CitizenId = table.Column<string>(type: "varchar(13)", maxLength: 13, nullable: true, comment: "รหัสบัตรประชาชน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
FirstName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "ชื่อ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastName = table.Column<string>(type: "varchar(100)", maxLength: 100, nullable: false, comment: "นามสกุล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Organization = table.Column<string>(type: "longtext", nullable: true, comment: "สังกัด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PersonId = table.Column<Guid>(type: "char(36)", nullable: true, comment: "id อ้างอิง profile", collation: "ascii_general_ci"),
|
||||
PosNo = table.Column<string>(type: "longtext", nullable: true, comment: "เลขที่ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Position = table.Column<string>(type: "longtext", nullable: true, comment: "ตำแหน่ง")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
PositionLevel = table.Column<string>(type: "longtext", nullable: true, comment: "ระดับ")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Prefix = table.Column<string>(type: "longtext", nullable: true, comment: "คำนำหน้า")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
Salary = table.Column<double>(type: "double", nullable: true, comment: "เงินเดือน")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineInvestigate_Profiles", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Profiles_DisciplineInvestigates_Discip~",
|
||||
column: x => x.DisciplineInvestigateId,
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Profiles_DisciplineInvestigateId",
|
||||
table: "DisciplineInvestigate_Profiles",
|
||||
column: "DisciplineInvestigateId");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,794 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableDisciplineDisciplinary_DocOthers : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_ProfileComplaints");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineComplaintId",
|
||||
table: "DisciplineDisciplinarys",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinarys_DisciplineComplaintId",
|
||||
table: "DisciplineDisciplinarys",
|
||||
newName: "IX_DisciplineDisciplinarys_DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
newName: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
newName: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
newName: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
newName: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
newName: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "InvestigationStatusResult",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext",
|
||||
oldNullable: true,
|
||||
oldComment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "InvestigationDetail",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext",
|
||||
oldNullable: true,
|
||||
oldComment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryCaseFault",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "กรณีความผิด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateAllegation",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่รับทราบข้อกล่าวหา");
|
||||
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
name: "DisciplinaryDateEvident",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สรุปพยานหลักฐาน");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryFaultLevel",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ระดับโทษความผิด กรณีไม่ร้ายแรง: ภาคทัณฑ์, ตัดเงินเดือน, ลดขั้นเงินเดือน | กรณีร้ายแรง: ปลดออก, ไล่ออก")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryInvestigateAt",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สอบสวนที่")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryRecordAccuser",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "บันทึกถ้อยคำของผู้กล่าวหา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryRefLaw",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "อ้างอิงมาตราตามกฎหมาย")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinarySummaryEvidence",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สรุปพยานหลักฐานสนับสนุนข้อกล่าวหา")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "DisciplinaryWitnesses",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "พยานและบันทึกถ้อยคำพยาน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "ResultInvestigate",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ผลการตรวจสอบเรื่องสืบสวน")
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocOthers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocOthers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocOthers_DisciplineDisciplinarys_Dis~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocOthers_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocRecordAccusers",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocRecordAccusers", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocRecordAccusers_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocSummaryEvidences",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocSummaryEvidences", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocSummaryEvidences_Documents_Documen~",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "DisciplineDisciplinary_DocWitnessess",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "char(36)", nullable: false, comment: "PrimaryKey", collation: "ascii_general_ci"),
|
||||
CreatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: false, comment: "สร้างข้อมูลเมื่อ"),
|
||||
CreatedUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdatedAt = table.Column<DateTime>(type: "datetime(6)", nullable: true, comment: "แก้ไขข้อมูลล่าสุดเมื่อ"),
|
||||
LastUpdateUserId = table.Column<string>(type: "varchar(40)", maxLength: 40, nullable: false, comment: "User Id ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
CreatedFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่สร้างข้อมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
LastUpdateFullName = table.Column<string>(type: "varchar(200)", maxLength: 200, nullable: false, comment: "ชื่อ User ที่แก้ไขข้อมูลล่าสุด")
|
||||
.Annotation("MySql:CharSet", "utf8mb4"),
|
||||
DocumentId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci"),
|
||||
DisciplineDisciplinaryId = table.Column<Guid>(type: "char(36)", nullable: false, collation: "ascii_general_ci")
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_DisciplineDisciplinary_DocWitnessess", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinarys~",
|
||||
column: x => x.DisciplineDisciplinaryId,
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocWitnessess_Documents_DocumentId",
|
||||
column: x => x.DocumentId,
|
||||
principalTable: "Documents",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
})
|
||||
.Annotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocOthers_DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocOthers",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocOthers_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocOthers",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocRecordAccusers_DisciplineDisciplin~",
|
||||
table: "DisciplineDisciplinary_DocRecordAccusers",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocRecordAccusers_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocRecordAccusers",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DisciplineDiscipl~",
|
||||
table: "DisciplineDisciplinary_DocSummaryEvidences",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocSummaryEvidences_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocSummaryEvidences",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocWitnessess_DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocWitnessess",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocWitnessess_DocumentId",
|
||||
table: "DisciplineDisciplinary_DocWitnessess",
|
||||
column: "DocumentId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~",
|
||||
table: "DisciplineDisciplinarys",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_DisciplineDisciplinarys_DisciplineInvestigates_DisciplineInv~",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocOthers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocRecordAccusers");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocSummaryEvidences");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "DisciplineDisciplinary_DocWitnessess");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryCaseFault",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateAllegation",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryDateEvident",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryFaultLevel",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryInvestigateAt",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryRecordAccuser",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryRefLaw",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinarySummaryEvidence",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "DisciplinaryWitnesses",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "ResultInvestigate",
|
||||
table: "DisciplineDisciplinarys");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinarys",
|
||||
newName: "DisciplineComplaintId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinarys_DisciplineInvestigateId",
|
||||
table: "DisciplineDisciplinarys",
|
||||
newName: "IX_DisciplineDisciplinarys_DisciplineComplaintId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineDisciplinar~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineDis~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
newName: "IX_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineDi~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
newName: "DisciplineInvestigateId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineDiscip~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
newName: "IX_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_ProfileComplaints",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "InvestigationStatusResult",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "สถานะหรือผลการสืบสวน (not_specified คือ ยังไม่ระบุ, have_cause คือ มีมูล, no_cause คือ ไม่มีมูล",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext",
|
||||
oldNullable: true,
|
||||
oldComment: "สถานะหรือผลการสืบสวน (NOT_SPECIFIED คือ ยังไม่ระบุ, HAVE_CAUSE คือ มีมูล, NO_CAUSE คือ ไม่มีมูล")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.AlterColumn<string>(
|
||||
name: "InvestigationDetail",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "longtext",
|
||||
nullable: true,
|
||||
comment: "ลักษณะการสืบสวน (appoint_directors คือ แต่งตั้งกรรมการสืบสวน, secret_investigation คือ สืบสวนทางลับ, other คือ อื่น ๆ)",
|
||||
oldClrType: typeof(string),
|
||||
oldType: "longtext",
|
||||
oldNullable: true,
|
||||
oldComment: "ลักษณะการสืบสวน (APPOINT_DIRECTORS คือ แต่งตั้งกรรมการสืบสวน, SECRET_INVESTIGATION คือ สืบสวนทางลับ, OTHER คือ อื่น ๆ)")
|
||||
.Annotation("MySql:CharSet", "utf8mb4")
|
||||
.OldAnnotation("MySql:CharSet", "utf8mb4");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Docs_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_DocComplaints_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_DisciplineInvestigate_Directors_DisciplineDisciplinaryId",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineDisciplinaryId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DirectorInvestigates_DisciplineInvest~",
|
||||
table: "DisciplineDisciplinary_DirectorInvestigates",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocComplaintInvestigates_DisciplineIn~",
|
||||
table: "DisciplineDisciplinary_DocComplaintInvestigates",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigateRelevants_DisciplineInv~",
|
||||
table: "DisciplineDisciplinary_DocInvestigateRelevants",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_DocInvestigates_DisciplineInvestigate~",
|
||||
table: "DisciplineDisciplinary_DocInvestigates",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinary_ProfileComplaintInvestigates_Discipli~",
|
||||
table: "DisciplineDisciplinary_ProfileComplaintInvestigates",
|
||||
column: "DisciplineInvestigateId",
|
||||
principalTable: "DisciplineInvestigates",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineDisciplinarys_DisciplineComplaints_DisciplineCompl~",
|
||||
table: "DisciplineDisciplinarys",
|
||||
column: "DisciplineComplaintId",
|
||||
principalTable: "DisciplineComplaints",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Directors_DisciplineDisciplinarys_Disc~",
|
||||
table: "DisciplineInvestigate_Directors",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_DocComplaints_DisciplineDisciplinarys_~",
|
||||
table: "DisciplineInvestigate_DocComplaints",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_Docs_DisciplineDisciplinarys_Disciplin~",
|
||||
table: "DisciplineInvestigate_Docs",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigate_ProfileComplaints_DisciplineDisciplina~",
|
||||
table: "DisciplineInvestigate_ProfileComplaints",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_DisciplineInvestigateRelevant_Docs_DisciplineDisciplinarys_D~",
|
||||
table: "DisciplineInvestigateRelevant_Docs",
|
||||
column: "DisciplineDisciplinaryId",
|
||||
principalTable: "DisciplineDisciplinarys",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -0,0 +1,107 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace BMA.EHR.Infrastructure.Migrations.DisciplineDb
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public partial class addtableDisciplineDisciplinary_DocWitnessess : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateStart",
|
||||
table: "DisciplineInvestigates",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่เริ่มการสืบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่เริ่มการสอบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateEnd",
|
||||
table: "DisciplineInvestigates",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สิ้นสุดการสืบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่สิ้นสุดการสอบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateStart",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่เริ่มการสืบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่เริ่มการสอบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateEnd",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สิ้นสุดการสืบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่สิ้นสุดการสอบสวน");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateStart",
|
||||
table: "DisciplineInvestigates",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่เริ่มการสอบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่เริ่มการสืบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateEnd",
|
||||
table: "DisciplineInvestigates",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สิ้นสุดการสอบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่สิ้นสุดการสืบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateStart",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่เริ่มการสอบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่เริ่มการสืบสวน");
|
||||
|
||||
migrationBuilder.AlterColumn<DateTime>(
|
||||
name: "InvestigationDateEnd",
|
||||
table: "DisciplineDisciplinarys",
|
||||
type: "datetime(6)",
|
||||
nullable: true,
|
||||
comment: "วันที่สิ้นสุดการสอบสวน",
|
||||
oldClrType: typeof(DateTime),
|
||||
oldType: "datetime(6)",
|
||||
oldNullable: true,
|
||||
oldComment: "วันที่สิ้นสุดการสืบสวน");
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
|
|
@ -21,11 +21,22 @@ namespace BMA.EHR.Infrastructure.Persistence
|
|||
public DbSet<DisciplineComplaint_Doc> DisciplineComplaint_Docs { get; set; }
|
||||
|
||||
public DbSet<DisciplineInvestigate> DisciplineInvestigates { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Profile> DisciplineInvestigate_Profiles { get; set; }
|
||||
public DbSet<DisciplineInvestigate_ProfileComplaint> DisciplineInvestigate_ProfileComplaints { get; set; }
|
||||
public DbSet<DisciplineInvestigate_DocComplaint> DisciplineInvestigate_DocComplaints { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Doc> DisciplineInvestigate_Docs { get; set; }
|
||||
public DbSet<DisciplineInvestigate_Director> DisciplineInvestigate_Directors { get; set; }
|
||||
public DbSet<DisciplineInvestigateRelevant_Doc> DisciplineInvestigateRelevant_Docs { get; set; }
|
||||
|
||||
public DbSet<DisciplineDisciplinary> DisciplineDisciplinarys { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_ProfileComplaintInvestigate> DisciplineDisciplinary_ProfileComplaintInvestigates { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocInvestigateRelevant> DisciplineDisciplinary_DocInvestigateRelevants { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocInvestigate> DisciplineDisciplinary_DocInvestigates { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocComplaintInvestigate> DisciplineDisciplinary_DocComplaintInvestigates { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DirectorInvestigate> DisciplineDisciplinary_DirectorInvestigates { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocSummaryEvidence> DisciplineDisciplinary_DocSummaryEvidences { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocRecordAccuser> DisciplineDisciplinary_DocRecordAccusers { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocWitnesses> DisciplineDisciplinary_DocWitnessess { get; set; }
|
||||
public DbSet<DisciplineDisciplinary_DocOther> DisciplineDisciplinary_DocOthers { get; set; }
|
||||
public DbSet<Document> Documents { get; set; }
|
||||
|
||||
#endregion
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue