更改数据库字段

This commit is contained in:
橙子
2021-10-20 15:40:19 +08:00
parent 4793297f5e
commit dcb51eb212
9 changed files with 329 additions and 31 deletions

View File

@@ -0,0 +1,87 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace Yi.Framework.Model.Migrations
{
public partial class yi3 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<string>(
name: "address",
table: "user",
type: "TEXT",
nullable: true);
migrationBuilder.AddColumn<int>(
name: "phone",
table: "user",
type: "INTEGER",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "sort",
table: "menu",
type: "INTEGER",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "INTEGER",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "is_top",
table: "menu",
type: "INTEGER",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "INTEGER",
oldNullable: true);
migrationBuilder.AlterColumn<int>(
name: "is_show",
table: "menu",
type: "INTEGER",
nullable: false,
defaultValue: 0,
oldClrType: typeof(int),
oldType: "INTEGER",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "address",
table: "user");
migrationBuilder.DropColumn(
name: "phone",
table: "user");
migrationBuilder.AlterColumn<int>(
name: "sort",
table: "menu",
type: "INTEGER",
nullable: true,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<int>(
name: "is_top",
table: "menu",
type: "INTEGER",
nullable: true,
oldClrType: typeof(int),
oldType: "INTEGER");
migrationBuilder.AlterColumn<int>(
name: "is_show",
table: "menu",
type: "INTEGER",
nullable: true,
oldClrType: typeof(int),
oldType: "INTEGER");
}
}
}