105 lines
3.6 KiB
C#
105 lines
3.6 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace BMA.EHR.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class updatetableplacementAddposition : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PlacementProfiles_PositionLevels_PositionLevelId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_PlacementProfiles_PositionTypes_PositionTypeId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PlacementProfiles_PositionLevelId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_PlacementProfiles_PositionTypeId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PositionLevelId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PositionTypeId",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "PositionLevel",
|
|
table: "PlacementProfiles",
|
|
type: "longtext",
|
|
nullable: true,
|
|
comment: "ระดับ")
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
|
|
migrationBuilder.AddColumn<string>(
|
|
name: "PositionType",
|
|
table: "PlacementProfiles",
|
|
type: "longtext",
|
|
nullable: true,
|
|
comment: "ประเภทตำแหน่ง")
|
|
.Annotation("MySql:CharSet", "utf8mb4");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropColumn(
|
|
name: "PositionLevel",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "PositionType",
|
|
table: "PlacementProfiles");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "PositionLevelId",
|
|
table: "PlacementProfiles",
|
|
type: "char(36)",
|
|
nullable: true,
|
|
collation: "ascii_general_ci");
|
|
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "PositionTypeId",
|
|
table: "PlacementProfiles",
|
|
type: "char(36)",
|
|
nullable: true,
|
|
collation: "ascii_general_ci");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PlacementProfiles_PositionLevelId",
|
|
table: "PlacementProfiles",
|
|
column: "PositionLevelId");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_PlacementProfiles_PositionTypeId",
|
|
table: "PlacementProfiles",
|
|
column: "PositionTypeId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PlacementProfiles_PositionLevels_PositionLevelId",
|
|
table: "PlacementProfiles",
|
|
column: "PositionLevelId",
|
|
principalTable: "PositionLevels",
|
|
principalColumn: "Id");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_PlacementProfiles_PositionTypes_PositionTypeId",
|
|
table: "PlacementProfiles",
|
|
column: "PositionTypeId",
|
|
principalTable: "PositionTypes",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
}
|