using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Fengling.Backend.Infrastructure.Migrations { /// public partial class RemoveNotificationAggregate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Notifications"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Notifications", columns: table => new { Id = table.Column(type: "TEXT", nullable: false, comment: "通知ID"), Content = table.Column(type: "TEXT", maxLength: 500, nullable: false, comment: "内容"), CreatedAt = table.Column(type: "TEXT", nullable: false, comment: "创建时间"), Data = table.Column(type: "TEXT", maxLength: 2000, nullable: true, comment: "附加数据(JSON格式)"), Deleted = table.Column(type: "INTEGER", nullable: false), IsRead = table.Column(type: "INTEGER", nullable: false, comment: "是否已读"), MemberId = table.Column(type: "TEXT", nullable: false, comment: "会员ID"), RowVersion = table.Column(type: "INTEGER", nullable: false), Title = table.Column(type: "TEXT", maxLength: 100, nullable: false, comment: "标题"), Type = table.Column(type: "INTEGER", nullable: false, comment: "通知类型(1:积分获得成功,2:积分获得失败,3:积分消费,4:积分过期,5:积分退还,6:系统通知)") }, constraints: table => { table.PrimaryKey("PK_Notifications", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_Notifications_CreatedAt", table: "Notifications", column: "CreatedAt"); migrationBuilder.CreateIndex( name: "IX_Notifications_IsRead", table: "Notifications", column: "IsRead"); migrationBuilder.CreateIndex( name: "IX_Notifications_MemberId", table: "Notifications", column: "MemberId"); migrationBuilder.CreateIndex( name: "IX_Notifications_Type", table: "Notifications", column: "Type"); } } }