using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace wtmProject.DataAccess.Migrations { public partial class hmr2024040101 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "WTM_BUSINESS", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), CustomId = table.Column(type: "uniqueidentifier", nullable: true), VisitObjectId = table.Column(type: "uniqueidentifier", nullable: true), ProjectId = table.Column(type: "uniqueidentifier", nullable: true), BusinessName = table.Column(type: "nvarchar(max)", nullable: true), BusinessStatus = table.Column(type: "int", nullable: true), MarkManageId = table.Column(type: "uniqueidentifier", nullable: true), Requirement = table.Column(type: "nvarchar(max)", nullable: true), Proposal = table.Column(type: "nvarchar(max)", nullable: true), BusinessProject = table.Column(type: "nvarchar(max)", nullable: true), Follow = table.Column(type: "nvarchar(max)", nullable: true), Negotiation = table.Column(type: "nvarchar(max)", nullable: true), TenantCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), CreateTime = table.Column(type: "datetime2", nullable: true), CreateBy = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true), UpdateTime = table.Column(type: "datetime2", nullable: true), UpdateBy = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: true) }, constraints: table => { table.PrimaryKey("PK_WTM_BUSINESS", x => x.ID); table.ForeignKey( name: "FK_WTM_BUSINESS_FrameworkUsers_MarkManageId", column: x => x.MarkManageId, principalTable: "FrameworkUsers", principalColumn: "ID"); table.ForeignKey( name: "FK_WTM_BUSINESS_WTM_CUSTOM_CustomId", column: x => x.CustomId, principalTable: "WTM_CUSTOM", principalColumn: "ID"); table.ForeignKey( name: "FK_WTM_BUSINESS_WTM_CUSTOM_PERSON_VisitObjectId", column: x => x.VisitObjectId, principalTable: "WTM_CUSTOM_PERSON", principalColumn: "ID"); table.ForeignKey( name: "FK_WTM_BUSINESS_WTM_PROJECT_ProjectId", column: x => x.ProjectId, principalTable: "WTM_PROJECT", principalColumn: "ID"); }); migrationBuilder.CreateIndex( name: "IX_WTM_BUSINESS_CustomId", table: "WTM_BUSINESS", column: "CustomId"); migrationBuilder.CreateIndex( name: "IX_WTM_BUSINESS_MarkManageId", table: "WTM_BUSINESS", column: "MarkManageId"); migrationBuilder.CreateIndex( name: "IX_WTM_BUSINESS_ProjectId", table: "WTM_BUSINESS", column: "ProjectId"); migrationBuilder.CreateIndex( name: "IX_WTM_BUSINESS_VisitObjectId", table: "WTM_BUSINESS", column: "VisitObjectId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "WTM_BUSINESS"); } } }