| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376 | 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<Guid>(nullable: false),                    AccountID = table.Column<string>(nullable: true),                    ChangePassword = table.Column<string>(nullable: true)                },                constraints: table =>                {                    table.PrimaryKey("PK_Accounts", x => x.Id);                });            migrationBuilder.CreateTable(                name: "AllNumbers",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateA = table.Column<DateTime>(nullable: false),                    PlanA = table.Column<double>(nullable: false),                    RealityA = table.Column<double>(nullable: false),                    OkA = table.Column<double>(nullable: false),                    NgA = table.Column<double>(nullable: false),                    ErrA = table.Column<double>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_AllNumbers", x => x.Id);                });            migrationBuilder.CreateTable(                name: "DeviceStatus",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateDS = table.Column<DateTime>(nullable: false),                    AlarmTime = table.Column<double>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_DeviceStatus", x => x.Id);                });            migrationBuilder.CreateTable(                name: "Houses",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateH = table.Column<DateTime>(nullable: false),                    LackH = table.Column<string>(nullable: true),                    UsedH = table.Column<string>(nullable: true),                    TotalH = table.Column<string>(nullable: true)                },                constraints: table =>                {                    table.PrimaryKey("PK_Houses", x => x.Id);                });            migrationBuilder.CreateTable(                name: "Informations",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    CreateTime = table.Column<DateTime>(nullable: false),                    OperatorCode = table.Column<string>(nullable: true),                    ProCode = table.Column<string>(nullable: true),                    SpendTime = table.Column<double>(nullable: false),                    ProType = table.Column<string>(nullable: true),                    ProNo = table.Column<string>(nullable: true),                    ItemCode = table.Column<string>(nullable: true),                    OrderNo = table.Column<string>(nullable: true),                    TestResult = table.Column<string>(nullable: true)                },                constraints: table =>                {                    table.PrimaryKey("PK_Informations", x => x.Id);                });            migrationBuilder.CreateTable(                name: "OutofWorks",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateOutWork = table.Column<DateTime>(nullable: false),                    Actual = table.Column<int>(nullable: false),                    FallIll = table.Column<int>(nullable: false),                    Absenteeism = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_OutofWorks", x => x.Id);                });            migrationBuilder.CreateTable(                name: "ParamLogs",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    Occured = table.Column<DateTime>(nullable: false),                    Content = table.Column<string>(nullable: true),                    OperateAction = table.Column<int>(nullable: false),                    OperateObject = table.Column<string>(nullable: true),                    UserName = table.Column<string>(nullable: true)                },                constraints: table =>                {                    table.PrimaryKey("PK_ParamLogs", x => x.Id);                });            migrationBuilder.CreateTable(                name: "Persons",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    EmployeeName = table.Column<string>(nullable: true),                    ProProcess = table.Column<string>(nullable: true),                    WorkTime = table.Column<string>(nullable: true),                    Yield = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_Persons", x => x.Id);                });            migrationBuilder.CreateTable(                name: "ProductResult",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    Result = table.Column<double>(nullable: false),                    Datetime = table.Column<DateTime>(nullable: false),                    Barcode = table.Column<string>(nullable: true),                    Juge = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_ProductResult", x => x.Id);                });            migrationBuilder.CreateTable(                name: "ProStatus",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateS = table.Column<DateTime>(nullable: false),                    OrdNoS = table.Column<string>(nullable: true),                    PlanS = table.Column<double>(nullable: false),                    RealityS = table.Column<int>(nullable: false),                    OkS = table.Column<int>(nullable: false),                    NgS = table.Column<int>(nullable: false),                    ErrS = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_ProStatus", x => x.Id);                });            migrationBuilder.CreateTable(                name: "Qualitys",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    DateQuality = table.Column<DateTime>(nullable: false),                    QuPCode = table.Column<string>(nullable: true),                    Q1 = table.Column<int>(nullable: false),                    Q2 = table.Column<int>(nullable: false),                    Q3 = table.Column<int>(nullable: false),                    Q4 = table.Column<int>(nullable: false),                    Q5 = table.Column<int>(nullable: false),                    Q6 = table.Column<int>(nullable: false),                    Q7 = table.Column<int>(nullable: false),                    Q8 = table.Column<int>(nullable: false),                    Q9 = table.Column<int>(nullable: false),                    Q10 = table.Column<int>(nullable: false),                    Q11 = table.Column<int>(nullable: false),                    Q12 = table.Column<int>(nullable: false),                    Q13 = table.Column<int>(nullable: false),                    Q14 = table.Column<int>(nullable: false),                    Q15 = table.Column<int>(nullable: false),                    Q16 = table.Column<int>(nullable: false),                    Q17 = table.Column<int>(nullable: false),                    Q18 = table.Column<int>(nullable: false),                    Q19 = table.Column<int>(nullable: false),                    Q20 = table.Column<int>(nullable: false),                    Q21 = table.Column<int>(nullable: false),                    Q22 = table.Column<int>(nullable: false),                    Q23 = table.Column<int>(nullable: false),                    Q24 = table.Column<int>(nullable: false),                    Q25 = table.Column<int>(nullable: false),                    Q26 = table.Column<int>(nullable: false),                    Q27 = table.Column<int>(nullable: false),                    Q28 = table.Column<int>(nullable: false),                    Q29 = table.Column<int>(nullable: false),                    Q30 = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_Qualitys", x => x.Id);                });            migrationBuilder.CreateTable(                name: "SopFiles",                columns: table => new                {                    ID = table.Column<Guid>(nullable: false),                    ProductName = table.Column<string>(nullable: true)                },                constraints: table =>                {                    table.PrimaryKey("PK_SopFiles", x => x.ID);                });            migrationBuilder.CreateTable(                name: "StatisticsLogs",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    Timestamp = table.Column<DateTime>(nullable: false),                    TraceState = table.Column<int>(nullable: false),                    RequstType = table.Column<int>(nullable: false),                    RequestCode = table.Column<int>(nullable: false)                },                constraints: table =>                {                    table.PrimaryKey("PK_StatisticsLogs", x => x.Id);                });            migrationBuilder.CreateTable(                name: "LocalFile",                columns: table => new                {                    Id = table.Column<Guid>(nullable: false),                    FileNum = table.Column<string>(nullable: true),                    Edition = table.Column<string>(nullable: true),                    Date = table.Column<string>(nullable: true),                    Type = table.Column<string>(nullable: true),                    People = table.Column<string>(nullable: true),                    Name = table.Column<string>(nullable: true),                    Process = table.Column<string>(nullable: true),                    WorkTime = table.Column<string>(nullable: true),                    SopFileID = table.Column<Guid>(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<Guid>(nullable: false),                    Num = table.Column<string>(nullable: true),                    MaterialNum = table.Column<string>(nullable: true),                    MaterialName = table.Column<string>(nullable: true),                    Count = table.Column<string>(nullable: true),                    Unit = table.Column<string>(nullable: true),                    SopFileID = table.Column<Guid>(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<Guid>(nullable: false),                    Equipment = table.Column<string>(nullable: true),                    Before = table.Column<string>(nullable: true),                    Inn = table.Column<string>(nullable: true),                    After = table.Column<string>(nullable: true),                    LookOut = table.Column<string>(nullable: true),                    SopFileID = table.Column<Guid>(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");        }    }}
 |