mh_custom/wtmProject.DataAccess/Migrations/20250113021913_hmr2025011301.cs

239 lines
8.1 KiB
C#
Raw Normal View History

2026-01-06 10:55:05 +08:00
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace wtmProject.DataAccess.Migrations
{
public partial class hmr2025011301 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_WTM_CONTRACT_WTM_AREA_AreaId",
table: "WTM_CONTRACT");
migrationBuilder.DropForeignKey(
name: "FK_WTM_CONTRACT_WTM_PROJECT_ProjectId",
table: "WTM_CONTRACT");
migrationBuilder.AlterColumn<DateTime>(
name: "SignDate",
table: "WTM_CONTRACT",
type: "datetime2",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
oldClrType: typeof(DateTime),
oldType: "datetime2",
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "ProjectId",
table: "WTM_CONTRACT",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ContractName",
table: "WTM_CONTRACT",
type: "nvarchar(100)",
maxLength: 100,
nullable: false,
defaultValue: "",
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100,
oldNullable: true);
migrationBuilder.AlterColumn<Guid>(
name: "AreaId",
table: "WTM_CONTRACT",
type: "uniqueidentifier",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldNullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "ActSignDate",
table: "WTM_BUSINESS",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "BusinessSource",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DealCycle",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DealMoney",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "DealRate",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "GetDate",
table: "WTM_BUSINESS",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Month",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<DateTime>(
name: "PreSignDate",
table: "WTM_BUSINESS",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "ProjectTarget",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddColumn<string>(
name: "Year",
table: "WTM_BUSINESS",
type: "nvarchar(max)",
nullable: true);
migrationBuilder.AddForeignKey(
name: "FK_WTM_CONTRACT_WTM_AREA_AreaId",
table: "WTM_CONTRACT",
column: "AreaId",
principalTable: "WTM_AREA",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_WTM_CONTRACT_WTM_PROJECT_ProjectId",
table: "WTM_CONTRACT",
column: "ProjectId",
principalTable: "WTM_PROJECT",
principalColumn: "ID",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_WTM_CONTRACT_WTM_AREA_AreaId",
table: "WTM_CONTRACT");
migrationBuilder.DropForeignKey(
name: "FK_WTM_CONTRACT_WTM_PROJECT_ProjectId",
table: "WTM_CONTRACT");
migrationBuilder.DropColumn(
name: "ActSignDate",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "BusinessSource",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "DealCycle",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "DealMoney",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "DealRate",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "GetDate",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "Month",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "PreSignDate",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "ProjectTarget",
table: "WTM_BUSINESS");
migrationBuilder.DropColumn(
name: "Year",
table: "WTM_BUSINESS");
migrationBuilder.AlterColumn<DateTime>(
name: "SignDate",
table: "WTM_CONTRACT",
type: "datetime2",
nullable: true,
oldClrType: typeof(DateTime),
oldType: "datetime2");
migrationBuilder.AlterColumn<Guid>(
name: "ProjectId",
table: "WTM_CONTRACT",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn<string>(
name: "ContractName",
table: "WTM_CONTRACT",
type: "nvarchar(100)",
maxLength: 100,
nullable: true,
oldClrType: typeof(string),
oldType: "nvarchar(100)",
oldMaxLength: 100);
migrationBuilder.AlterColumn<Guid>(
name: "AreaId",
table: "WTM_CONTRACT",
type: "uniqueidentifier",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AddForeignKey(
name: "FK_WTM_CONTRACT_WTM_AREA_AreaId",
table: "WTM_CONTRACT",
column: "AreaId",
principalTable: "WTM_AREA",
principalColumn: "ID");
migrationBuilder.AddForeignKey(
name: "FK_WTM_CONTRACT_WTM_PROJECT_ProjectId",
table: "WTM_CONTRACT",
column: "ProjectId",
principalTable: "WTM_PROJECT",
principalColumn: "ID");
}
}
}