using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace FlexJobApi.Database.Migrations.Migrations
{
///
public partial class UpdateMenu : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "IsHidden",
table: "Menu");
migrationBuilder.AlterTable(
name: "RoleResource",
comment: "角色资源");
migrationBuilder.AlterTable(
name: "Resource",
comment: "资源");
migrationBuilder.AlterColumn(
name: "RoleId",
table: "RoleResource",
type: "uniqueidentifier",
nullable: false,
comment: "角色Id",
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn(
name: "MenuId",
table: "RoleResource",
type: "uniqueidentifier",
nullable: false,
comment: "菜单Id",
oldClrType: typeof(Guid),
oldType: "uniqueidentifier");
migrationBuilder.AlterColumn(
name: "DataPower",
table: "RoleResource",
type: "int",
nullable: true,
comment: "数据权限",
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AlterColumn(
name: "Service",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "微服务",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "Route",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "路由",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "ResponseTypeName",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "响应类型名称",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "RequestTypeName",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "请求类型名称",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "Name",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "名称",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AlterColumn(
name: "Method",
table: "Resource",
type: "int",
nullable: false,
comment: "请求方式",
oldClrType: typeof(int),
oldType: "int");
migrationBuilder.AlterColumn(
name: "IsExpired",
table: "Resource",
type: "bit",
nullable: false,
comment: "是否已过期",
oldClrType: typeof(bool),
oldType: "bit");
migrationBuilder.AlterColumn(
name: "Code",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
comment: "编号",
oldClrType: typeof(string),
oldType: "nvarchar(max)");
migrationBuilder.AddColumn(
name: "ClientType",
table: "Menu",
type: "int",
nullable: false,
defaultValue: 0,
comment: "客户端类型");
migrationBuilder.AddColumn(
name: "UserType",
table: "Menu",
type: "int",
nullable: false,
defaultValue: 0,
comment: "用户类型");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "ClientType",
table: "Menu");
migrationBuilder.DropColumn(
name: "UserType",
table: "Menu");
migrationBuilder.AlterTable(
name: "RoleResource",
oldComment: "角色资源");
migrationBuilder.AlterTable(
name: "Resource",
oldComment: "资源");
migrationBuilder.AlterColumn(
name: "RoleId",
table: "RoleResource",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldComment: "角色Id");
migrationBuilder.AlterColumn(
name: "MenuId",
table: "RoleResource",
type: "uniqueidentifier",
nullable: false,
oldClrType: typeof(Guid),
oldType: "uniqueidentifier",
oldComment: "菜单Id");
migrationBuilder.AlterColumn(
name: "DataPower",
table: "RoleResource",
type: "int",
nullable: true,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true,
oldComment: "数据权限");
migrationBuilder.AlterColumn(
name: "Service",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "微服务");
migrationBuilder.AlterColumn(
name: "Route",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "路由");
migrationBuilder.AlterColumn(
name: "ResponseTypeName",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "响应类型名称");
migrationBuilder.AlterColumn(
name: "RequestTypeName",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "请求类型名称");
migrationBuilder.AlterColumn(
name: "Name",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "名称");
migrationBuilder.AlterColumn(
name: "Method",
table: "Resource",
type: "int",
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldComment: "请求方式");
migrationBuilder.AlterColumn(
name: "IsExpired",
table: "Resource",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit",
oldComment: "是否已过期");
migrationBuilder.AlterColumn(
name: "Code",
table: "Resource",
type: "nvarchar(max)",
nullable: false,
oldClrType: typeof(string),
oldType: "nvarchar(max)",
oldComment: "编号");
migrationBuilder.AddColumn(
name: "IsHidden",
table: "Menu",
type: "bit",
nullable: false,
defaultValue: false,
comment: "是否隐藏");
}
}
}