using System; using Microsoft.EntityFrameworkCore.Migrations; namespace Volo.CmsKit.Migrations { public partial class BlogPost_CoverImage : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "CmsContents"); migrationBuilder.AddColumn( name: "CoverImageMediaId", table: "CmsBlogPosts", type: "uniqueidentifier", nullable: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropColumn( name: "CoverImageMediaId", table: "CmsBlogPosts"); migrationBuilder.CreateTable( name: "CmsContents", columns: table => new { Id = table.Column(type: "uniqueidentifier", nullable: false), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true), CreationTime = table.Column(type: "datetime2", nullable: false), CreatorId = table.Column(type: "uniqueidentifier", nullable: true), DeleterId = table.Column(type: "uniqueidentifier", nullable: true), DeletionTime = table.Column(type: "datetime2", nullable: true), EntityId = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), EntityType = table.Column(type: "nvarchar(64)", maxLength: 64, nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), IsDeleted = table.Column(type: "bit", nullable: false, defaultValue: false), LastModificationTime = table.Column(type: "datetime2", nullable: true), LastModifierId = table.Column(type: "uniqueidentifier", nullable: true), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Value = table.Column(type: "nvarchar(max)", maxLength: 2147483647, nullable: false) }, constraints: table => { table.PrimaryKey("PK_CmsContents", x => x.Id); }); migrationBuilder.CreateIndex( name: "IX_CmsContents_TenantId_EntityType_EntityId", table: "CmsContents", columns: new[] { "TenantId", "EntityType", "EntityId" }); } } }