using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace YGNT.QuestionLibrary.Migrations
{
    public partial class addquestionConvertTask : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "QuestionResolves",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<int>(
                name: "QuestionConvertState",
                table: "QuestionOrigins",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AlterColumn<long>(
                name: "QuestionId",
                table: "QuestionConvertTasks",
                nullable: true,
                oldClrType: typeof(long),
                oldType: "bigint");

            migrationBuilder.AlterColumn<long>(
                name: "Id",
                table: "QuestionConvertTasks",
                nullable: false,
                oldClrType: typeof(int),
                oldType: "int")
                .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
                .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);

            migrationBuilder.AddColumn<int>(
                name: "QuestionConvertType",
                table: "QuestionConvertTasks",
                nullable: false,
                defaultValue: 0);

            migrationBuilder.AddColumn<long>(
                name: "QuestionOriginId",
                table: "QuestionConvertTasks",
                nullable: false,
                defaultValue: 0L);

            migrationBuilder.AddColumn<string>(
                name: "Remark",
                table: "QuestionConvertTasks",
                nullable: true);

            migrationBuilder.AddColumn<int>(
                name: "TaskState",
                table: "QuestionConvertTasks",
                nullable: false,
                defaultValue: 0);
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "QuestionResolves");

            migrationBuilder.DropColumn(
                name: "QuestionConvertState",
                table: "QuestionOrigins");

            migrationBuilder.DropColumn(
                name: "QuestionConvertType",
                table: "QuestionConvertTasks");

            migrationBuilder.DropColumn(
                name: "QuestionOriginId",
                table: "QuestionConvertTasks");

            migrationBuilder.DropColumn(
                name: "Remark",
                table: "QuestionConvertTasks");

            migrationBuilder.DropColumn(
                name: "TaskState",
                table: "QuestionConvertTasks");

            migrationBuilder.AlterColumn<long>(
                name: "QuestionId",
                table: "QuestionConvertTasks",
                type: "bigint",
                nullable: false,
                oldClrType: typeof(long),
                oldNullable: true);

            migrationBuilder.AlterColumn<int>(
                name: "Id",
                table: "QuestionConvertTasks",
                type: "int",
                nullable: false,
                oldClrType: typeof(long))
                .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
                .OldAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
        }
    }
}
