using System;
using Microsoft.EntityFrameworkCore.Migrations;

namespace MineTec.ProManager.Migrations
{
    public partial class Bom : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "BOM",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: true),
                    CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
                    CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(nullable: true),
                    UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
                    UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
                    DesignAssyNum = table.Column<string>(nullable: true),
                    Name = table.Column<string>(maxLength: 300, nullable: true),
                    Remark = table.Column<string>(maxLength: 300, nullable: true),
                    IsAnnex = table.Column<int>(nullable: false),
                    IsDelete = table.Column<int>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BOM", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "BOMDetails",
                columns: table => new
                {
                    Id = table.Column<Guid>(nullable: false),
                    CreateTime = table.Column<DateTime>(nullable: true),
                    CreateUserID = table.Column<string>(maxLength: 50, nullable: true),
                    CreateUserName = table.Column<string>(maxLength: 50, nullable: true),
                    UpdateTime = table.Column<DateTime>(nullable: true),
                    UpdateUserID = table.Column<string>(maxLength: 50, nullable: true),
                    UpdateUserName = table.Column<string>(maxLength: 50, nullable: true),
                    BOMID = table.Column<string>(maxLength: 50, nullable: true),
                    RelationshipID = table.Column<string>(maxLength: 50, nullable: true),
                    RelationshipName = table.Column<string>(maxLength: 150, nullable: true),
                    CodeOrFigureNum = table.Column<string>(maxLength: 150, nullable: true),
                    NameAndSpecs = table.Column<string>(maxLength: 150, nullable: true),
                    Materials = table.Column<string>(maxLength: 150, nullable: true),
                    SuppliersID = table.Column<string>(maxLength: 50, nullable: true),
                    SuppliersName = table.Column<string>(maxLength: 150, nullable: true),
                    AmountOfUnit = table.Column<decimal>(nullable: true),
                    Unit = table.Column<string>(maxLength: 150, nullable: true),
                    Price = table.Column<decimal>(nullable: true),
                    Amount = table.Column<decimal>(nullable: true),
                    Borrowings = table.Column<string>(maxLength: 200, nullable: true),
                    Remark = table.Column<string>(maxLength: 300, nullable: true),
                    RelatedPicID = table.Column<string>(maxLength: 50, nullable: true),
                    RelatedPicName = table.Column<string>(maxLength: 150, nullable: true),
                    IsAnnex = table.Column<int>(nullable: false),
                    IsDelete = table.Column<int>(nullable: false),
                    CreationTime = table.Column<DateTime>(nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_BOMDetails", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "BOM");

            migrationBuilder.DropTable(
                name: "BOMDetails");
        }
    }
}
