using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CMSMicroservice.Infrastructure.Persistence.Migrations { /// public partial class RemoveImagePathMaxLength : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_UserOrders_OrderVATs_OrderVATId", schema: "CMS", table: "UserOrders"); migrationBuilder.DropIndex( name: "IX_UserOrders_OrderVATId", schema: "CMS", table: "UserOrders"); migrationBuilder.DropColumn( name: "OrderVATId", schema: "CMS", table: "UserOrders"); migrationBuilder.AlterColumn( name: "ImageThumbnailPath", schema: "CMS", table: "SitePageSections", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "SitePageSections", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "HeroImagePath", schema: "CMS", table: "SitePages", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "DiscountProducts", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountProducts", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "DiscountProductImages", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountProductImages", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountCategories", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "FeaturedImageThumbnailPath", schema: "CMS", table: "BlogPosts", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "FeaturedImagePath", schema: "CMS", table: "BlogPosts", type: "nvarchar(max)", nullable: true, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500, oldNullable: true); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "BlogPostImages", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "BlogPostImages", type: "nvarchar(max)", nullable: false, oldClrType: typeof(string), oldType: "nvarchar(500)", oldMaxLength: 500); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "OrderVATId", schema: "CMS", table: "UserOrders", type: "bigint", nullable: true); migrationBuilder.AlterColumn( name: "ImageThumbnailPath", schema: "CMS", table: "SitePageSections", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "SitePageSections", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "HeroImagePath", schema: "CMS", table: "SitePages", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "DiscountProducts", type: "nvarchar(500)", maxLength: 500, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountProducts", type: "nvarchar(500)", maxLength: 500, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "DiscountProductImages", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountProductImages", type: "nvarchar(500)", maxLength: 500, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "DiscountCategories", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "FeaturedImageThumbnailPath", schema: "CMS", table: "BlogPosts", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "FeaturedImagePath", schema: "CMS", table: "BlogPosts", type: "nvarchar(500)", maxLength: 500, nullable: true, oldClrType: typeof(string), oldType: "nvarchar(max)", oldNullable: true); migrationBuilder.AlterColumn( name: "ThumbnailPath", schema: "CMS", table: "BlogPostImages", type: "nvarchar(500)", maxLength: 500, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.AlterColumn( name: "ImagePath", schema: "CMS", table: "BlogPostImages", type: "nvarchar(500)", maxLength: 500, nullable: false, oldClrType: typeof(string), oldType: "nvarchar(max)"); migrationBuilder.CreateIndex( name: "IX_UserOrders_OrderVATId", schema: "CMS", table: "UserOrders", column: "OrderVATId"); migrationBuilder.AddForeignKey( name: "FK_UserOrders_OrderVATs_OrderVATId", schema: "CMS", table: "UserOrders", column: "OrderVATId", principalSchema: "CMS", principalTable: "OrderVATs", principalColumn: "Id"); } } }