using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace IRaCIS.Core.Test.CodeFirstTest.MSSQL.Migrations
{
    /// <inheritdoc />
    public partial class addField : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<string>(
                name: "NewCreateName",
                table: "ProjectUser2",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<string>(
                name: "Code",
                table: "ProjectUser",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: false,
                defaultValue: "");

            migrationBuilder.AddColumn<string>(
                name: "Name2",
                table: "ProjectUser",
                type: "nvarchar(200)",
                maxLength: 200,
                nullable: false,
                defaultValue: "");

            migrationBuilder.CreateTable(
                name: "TestStr",
                columns: table => new
                {
                    Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    DefualtLength = table.Column<string>(type: "nvarchar(200)", maxLength: 200, nullable: false),
                    MaxLength = table.Column<string>(type: "nvarchar(max)", nullable: false),
                    DefineLength = table.Column<string>(type: "nvarchar(400)", maxLength: 400, nullable: false),
                    CreateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    CreateTime = table.Column<DateTime>(type: "datetime2", nullable: false),
                    UpdateUserId = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
                    UpdateTime = table.Column<DateTime>(type: "datetime2", nullable: false)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_TestStr", x => x.Id);
                });
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "TestStr");

            migrationBuilder.DropColumn(
                name: "NewCreateName",
                table: "ProjectUser2");

            migrationBuilder.DropColumn(
                name: "Code",
                table: "ProjectUser");

            migrationBuilder.DropColumn(
                name: "Name2",
                table: "ProjectUser");
        }
    }
}
