56 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
		
		
			
		
	
	
			56 lines
		
	
	
		
			1.9 KiB
		
	
	
	
		
			C#
		
	
	
	
	
	
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using Microsoft.EntityFrameworkCore.Migrations;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace APT.Data.Migrations.Migrations
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    public partial class hmr2025102303 : Migration
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        protected override void Up(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AddColumn<Guid>(
							 | 
						|||
| 
								 | 
							
								                name: "Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT",
							 | 
						|||
| 
								 | 
							
								                type: "uniqueidentifier",
							 | 
						|||
| 
								 | 
							
								                nullable: true);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AddColumn<Guid>(
							 | 
						|||
| 
								 | 
							
								                name: "PRODUCTION_UNIT_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT",
							 | 
						|||
| 
								 | 
							
								                type: "uniqueidentifier",
							 | 
						|||
| 
								 | 
							
								                nullable: true);
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.CreateIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_FM_DEPARTMENT_Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT",
							 | 
						|||
| 
								 | 
							
								                column: "Nav_UnitID");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.AddForeignKey(
							 | 
						|||
| 
								 | 
							
								                name: "FK_T_FM_DEPARTMENT_T_FM_USER_PRODUCTION_UNIT_SET_Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT",
							 | 
						|||
| 
								 | 
							
								                column: "Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                principalTable: "T_FM_USER_PRODUCTION_UNIT_SET",
							 | 
						|||
| 
								 | 
							
								                principalColumn: "ID",
							 | 
						|||
| 
								 | 
							
								                onDelete: ReferentialAction.Restrict);
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        protected override void Down(MigrationBuilder migrationBuilder)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropForeignKey(
							 | 
						|||
| 
								 | 
							
								                name: "FK_T_FM_DEPARTMENT_T_FM_USER_PRODUCTION_UNIT_SET_Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropIndex(
							 | 
						|||
| 
								 | 
							
								                name: "IX_T_FM_DEPARTMENT_Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropColumn(
							 | 
						|||
| 
								 | 
							
								                name: "Nav_UnitID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT");
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								            migrationBuilder.DropColumn(
							 | 
						|||
| 
								 | 
							
								                name: "PRODUCTION_UNIT_ID",
							 | 
						|||
| 
								 | 
							
								                table: "T_FM_DEPARTMENT");
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |