forked from ddrilling/AsbCloudServer
73 lines
2.5 KiB
C#
73 lines
2.5 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using System;
|
|
|
|
#nullable disable
|
|
|
|
namespace AsbCloudDb.Migrations
|
|
{
|
|
public partial class Update_IdState_For_User : Migration
|
|
{
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.UpdateData(
|
|
table: "t_user",
|
|
keyColumn: "state",
|
|
keyValue: null,
|
|
column: "state",
|
|
value: (short)1);
|
|
|
|
migrationBuilder.AlterColumn<short>(
|
|
name: "state",
|
|
table: "t_user",
|
|
type: "smallint",
|
|
nullable: false,
|
|
defaultValue: (short)0,
|
|
comment: "состояние:\n0 - не активен, \n1 - активен, \n2 - заблокирован",
|
|
oldClrType: typeof(short),
|
|
oldType: "smallint",
|
|
oldNullable: true,
|
|
oldComment: "состояние:\n100 - удален");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "id_category",
|
|
table: "t_help_page",
|
|
type: "integer",
|
|
nullable: false,
|
|
comment: "Id категории файла",
|
|
oldClrType: typeof(int),
|
|
oldType: "integer",
|
|
oldComment: "id категории файла");
|
|
}
|
|
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AlterColumn<short>(
|
|
name: "state",
|
|
table: "t_user",
|
|
type: "smallint",
|
|
nullable: true,
|
|
comment: "состояние:\n100 - удален",
|
|
oldClrType: typeof(short),
|
|
oldType: "smallint",
|
|
oldComment: "состояние:\n0 - не активен, \n1 - активен, \n2 - заблокирован");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "id_category",
|
|
table: "t_help_page",
|
|
type: "integer",
|
|
nullable: false,
|
|
comment: "id категории файла",
|
|
oldClrType: typeof(int),
|
|
oldType: "integer",
|
|
oldComment: "Id категории файла");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "t_user",
|
|
keyColumn: "id",
|
|
keyValue: 1,
|
|
column: "state",
|
|
value: null);
|
|
}
|
|
}
|
|
}
|