using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace wtmProject.DataAccess.Migrations { public partial class hmr2024031202 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "FrameworkCustoms", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), CustomCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), CustomName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), 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_FrameworkCustoms", x => x.ID); }); migrationBuilder.CreateTable( name: "FrameworkProjects", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), ProjectCode = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), ProjectName = table.Column(type: "nvarchar(50)", maxLength: 50, nullable: false), 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_FrameworkProjects", x => x.ID); }); migrationBuilder.CreateTable( name: "FrameworkOutRecords", columns: table => new { ID = table.Column(type: "uniqueidentifier", nullable: false), UserId = table.Column(type: "uniqueidentifier", nullable: true), City = table.Column(type: "nvarchar(200)", maxLength: 200, nullable: true), OutStartTime = table.Column(type: "datetime2", nullable: true), OutEndTime = table.Column(type: "datetime2", nullable: true), OutRecordType = table.Column(type: "int", nullable: true), CustomId = table.Column(type: "uniqueidentifier", nullable: true), ProjectId = table.Column(type: "uniqueidentifier", nullable: true), Remark = table.Column(type: "nvarchar(500)", maxLength: 500, 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_FrameworkOutRecords", x => x.ID); table.ForeignKey( name: "FK_FrameworkOutRecords_FrameworkCustoms_CustomId", column: x => x.CustomId, principalTable: "FrameworkCustoms", principalColumn: "ID"); table.ForeignKey( name: "FK_FrameworkOutRecords_FrameworkProjects_ProjectId", column: x => x.ProjectId, principalTable: "FrameworkProjects", principalColumn: "ID"); table.ForeignKey( name: "FK_FrameworkOutRecords_FrameworkUsers_UserId", column: x => x.UserId, principalTable: "FrameworkUsers", principalColumn: "ID"); }); migrationBuilder.CreateIndex( name: "IX_FrameworkOutRecords_CustomId", table: "FrameworkOutRecords", column: "CustomId"); migrationBuilder.CreateIndex( name: "IX_FrameworkOutRecords_ProjectId", table: "FrameworkOutRecords", column: "ProjectId"); migrationBuilder.CreateIndex( name: "IX_FrameworkOutRecords_UserId", table: "FrameworkOutRecords", column: "UserId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "FrameworkOutRecords"); migrationBuilder.DropTable( name: "FrameworkCustoms"); migrationBuilder.DropTable( name: "FrameworkProjects"); } } }