126 lines
4.4 KiB
C#
126 lines
4.4 KiB
C#
|
|
using System;
|
|||
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|
|||
|
|
namespace APT.Data.Migrations.Migrations
|
|||
|
|
{
|
|||
|
|
public partial class hmr2025120601 : Migration
|
|||
|
|
{
|
|||
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.AlterColumn<Guid>(
|
|||
|
|
name: "USER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true,
|
|||
|
|
oldClrType: typeof(Guid),
|
|||
|
|
oldType: "uniqueidentifier");
|
|||
|
|
|
|||
|
|
migrationBuilder.AddColumn<Guid>(
|
|||
|
|
name: "CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddColumn<Guid>(
|
|||
|
|
name: "DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddColumn<Guid>(
|
|||
|
|
name: "TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: true);
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "CLASS_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "DRIVER_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.CreateIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "TECH_ID");
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_CLASS_CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "CLASS_ID",
|
|||
|
|
principalTable: "T_FM_CLASS",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_USER_DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "DRIVER_ID",
|
|||
|
|
principalTable: "T_FM_USER",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
|
|||
|
|
migrationBuilder.AddForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_USER_TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
column: "TECH_ID",
|
|||
|
|
principalTable: "T_FM_USER",
|
|||
|
|
principalColumn: "ID",
|
|||
|
|
onDelete: ReferentialAction.Restrict);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
|
{
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_CLASS_CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_USER_DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropForeignKey(
|
|||
|
|
name: "FK_T_FO_SCHEDULING_T_FM_USER_TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropIndex(
|
|||
|
|
name: "IX_T_FO_SCHEDULING_TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "CLASS_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "DRIVER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.DropColumn(
|
|||
|
|
name: "TECH_ID",
|
|||
|
|
table: "T_FO_SCHEDULING");
|
|||
|
|
|
|||
|
|
migrationBuilder.AlterColumn<Guid>(
|
|||
|
|
name: "USER_ID",
|
|||
|
|
table: "T_FO_SCHEDULING",
|
|||
|
|
type: "uniqueidentifier",
|
|||
|
|
nullable: false,
|
|||
|
|
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
|||
|
|
oldClrType: typeof(Guid),
|
|||
|
|
oldType: "uniqueidentifier",
|
|||
|
|
oldNullable: true);
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|