YD_WeChatApplet.Api/WeChatApplet/Migrations/20250528053406_20250528v1.cs

38 lines
1.2 KiB
C#
Raw Normal View History

2025-06-06 14:57:20 +08:00
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace YD_WeChatApplet.Api.Migrations
{
public partial class _20250528v1 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.Sql(@"
IF EXISTS (SELECT * FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'TestTable')
BEGIN
DROP TABLE [TestTable];
END
");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "TestTable",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false, comment: "Id")
.Annotation("SqlServer:Identity", "1, 1"),
Json = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "Json"),
Name = table.Column<string>(type: "nvarchar(100)", nullable: false, comment: "Name")
},
constraints: table =>
{
table.PrimaryKey("PK_TestTable", x => x.Id);
});
}
}
}