using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Repository.Migrations { public partial class _20241019 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Accounts", columns: table => new { Id = table.Column(nullable: false), AccountID = table.Column(nullable: true), ChangePassword = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Accounts", x => x.Id); }); migrationBuilder.CreateTable( name: "AllNumbers", columns: table => new { Id = table.Column(nullable: false), DateA = table.Column(nullable: false), PlanA = table.Column(nullable: false), RealityA = table.Column(nullable: false), OkA = table.Column(nullable: false), NgA = table.Column(nullable: false), ErrA = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_AllNumbers", x => x.Id); }); migrationBuilder.CreateTable( name: "DeviceStatus", columns: table => new { Id = table.Column(nullable: false), DateDS = table.Column(nullable: false), AlarmTime = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_DeviceStatus", x => x.Id); }); migrationBuilder.CreateTable( name: "Houses", columns: table => new { Id = table.Column(nullable: false), DateH = table.Column(nullable: false), LackH = table.Column(nullable: true), UsedH = table.Column(nullable: true), TotalH = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Houses", x => x.Id); }); migrationBuilder.CreateTable( name: "Informations", columns: table => new { Id = table.Column(nullable: false), CreateTime = table.Column(nullable: false), OperatorCode = table.Column(nullable: true), ProCode = table.Column(nullable: true), SpendTime = table.Column(nullable: false), ProType = table.Column(nullable: true), ProNo = table.Column(nullable: true), ItemCode = table.Column(nullable: true), OrderNo = table.Column(nullable: true), TestResult = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Informations", x => x.Id); }); migrationBuilder.CreateTable( name: "OutofWorks", columns: table => new { Id = table.Column(nullable: false), DateOutWork = table.Column(nullable: false), Actual = table.Column(nullable: false), FallIll = table.Column(nullable: false), Absenteeism = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_OutofWorks", x => x.Id); }); migrationBuilder.CreateTable( name: "ParamLogs", columns: table => new { Id = table.Column(nullable: false), Occured = table.Column(nullable: false), Content = table.Column(nullable: true), OperateAction = table.Column(nullable: false), OperateObject = table.Column(nullable: true), UserName = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_ParamLogs", x => x.Id); }); migrationBuilder.CreateTable( name: "Persons", columns: table => new { Id = table.Column(nullable: false), EmployeeName = table.Column(nullable: true), ProProcess = table.Column(nullable: true), WorkTime = table.Column(nullable: true), Yield = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Persons", x => x.Id); }); migrationBuilder.CreateTable( name: "ProductResult", columns: table => new { Id = table.Column(nullable: false), Result = table.Column(nullable: false), Datetime = table.Column(nullable: false), Barcode = table.Column(nullable: true), Juge = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProductResult", x => x.Id); }); migrationBuilder.CreateTable( name: "ProStatus", columns: table => new { Id = table.Column(nullable: false), DateS = table.Column(nullable: false), OrdNoS = table.Column(nullable: true), PlanS = table.Column(nullable: false), RealityS = table.Column(nullable: false), OkS = table.Column(nullable: false), NgS = table.Column(nullable: false), ErrS = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ProStatus", x => x.Id); }); migrationBuilder.CreateTable( name: "Qualitys", columns: table => new { Id = table.Column(nullable: false), DateQuality = table.Column(nullable: false), QuPCode = table.Column(nullable: true), Q1 = table.Column(nullable: false), Q2 = table.Column(nullable: false), Q3 = table.Column(nullable: false), Q4 = table.Column(nullable: false), Q5 = table.Column(nullable: false), Q6 = table.Column(nullable: false), Q7 = table.Column(nullable: false), Q8 = table.Column(nullable: false), Q9 = table.Column(nullable: false), Q10 = table.Column(nullable: false), Q11 = table.Column(nullable: false), Q12 = table.Column(nullable: false), Q13 = table.Column(nullable: false), Q14 = table.Column(nullable: false), Q15 = table.Column(nullable: false), Q16 = table.Column(nullable: false), Q17 = table.Column(nullable: false), Q18 = table.Column(nullable: false), Q19 = table.Column(nullable: false), Q20 = table.Column(nullable: false), Q21 = table.Column(nullable: false), Q22 = table.Column(nullable: false), Q23 = table.Column(nullable: false), Q24 = table.Column(nullable: false), Q25 = table.Column(nullable: false), Q26 = table.Column(nullable: false), Q27 = table.Column(nullable: false), Q28 = table.Column(nullable: false), Q29 = table.Column(nullable: false), Q30 = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Qualitys", x => x.Id); }); migrationBuilder.CreateTable( name: "SopFiles", columns: table => new { ID = table.Column(nullable: false), ProductName = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_SopFiles", x => x.ID); }); migrationBuilder.CreateTable( name: "StatisticsLogs", columns: table => new { Id = table.Column(nullable: false), Timestamp = table.Column(nullable: false), TraceState = table.Column(nullable: false), RequstType = table.Column(nullable: false), RequestCode = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_StatisticsLogs", x => x.Id); }); migrationBuilder.CreateTable( name: "LocalFile", columns: table => new { Id = table.Column(nullable: false), FileNum = table.Column(nullable: true), Edition = table.Column(nullable: true), Date = table.Column(nullable: true), Type = table.Column(nullable: true), People = table.Column(nullable: true), Name = table.Column(nullable: true), Process = table.Column(nullable: true), WorkTime = table.Column(nullable: true), SopFileID = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_LocalFile", x => x.Id); table.ForeignKey( name: "FK_LocalFile_SopFiles_SopFileID", column: x => x.SopFileID, principalTable: "SopFiles", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "LocalFile2", columns: table => new { Id = table.Column(nullable: false), Num = table.Column(nullable: true), MaterialNum = table.Column(nullable: true), MaterialName = table.Column(nullable: true), Count = table.Column(nullable: true), Unit = table.Column(nullable: true), SopFileID = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_LocalFile2", x => x.Id); table.ForeignKey( name: "FK_LocalFile2_SopFiles_SopFileID", column: x => x.SopFileID, principalTable: "SopFiles", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "LocalFile3", columns: table => new { Id = table.Column(nullable: false), Equipment = table.Column(nullable: true), Before = table.Column(nullable: true), Inn = table.Column(nullable: true), After = table.Column(nullable: true), LookOut = table.Column(nullable: true), SopFileID = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_LocalFile3", x => x.Id); table.ForeignKey( name: "FK_LocalFile3_SopFiles_SopFileID", column: x => x.SopFileID, principalTable: "SopFiles", principalColumn: "ID", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_LocalFile_SopFileID", table: "LocalFile", column: "SopFileID"); migrationBuilder.CreateIndex( name: "IX_LocalFile2_SopFileID", table: "LocalFile2", column: "SopFileID"); migrationBuilder.CreateIndex( name: "IX_LocalFile3_SopFileID", table: "LocalFile3", column: "SopFileID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Accounts"); migrationBuilder.DropTable( name: "AllNumbers"); migrationBuilder.DropTable( name: "DeviceStatus"); migrationBuilder.DropTable( name: "Houses"); migrationBuilder.DropTable( name: "Informations"); migrationBuilder.DropTable( name: "LocalFile"); migrationBuilder.DropTable( name: "LocalFile2"); migrationBuilder.DropTable( name: "LocalFile3"); migrationBuilder.DropTable( name: "OutofWorks"); migrationBuilder.DropTable( name: "ParamLogs"); migrationBuilder.DropTable( name: "Persons"); migrationBuilder.DropTable( name: "ProductResult"); migrationBuilder.DropTable( name: "ProStatus"); migrationBuilder.DropTable( name: "Qualitys"); migrationBuilder.DropTable( name: "StatisticsLogs"); migrationBuilder.DropTable( name: "SopFiles"); } } }