using System; using Microsoft.EntityFrameworkCore.Migrations; namespace FileStorage.Migrations { public partial class _1272 : Migration { protected override void Up(MigrationBuilder migrationBuilder) { //migrationBuilder.DropTable( // name: "AbpBlobs"); //migrationBuilder.DropTable( // name: "AbpBlobContainers"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "AbpBlobContainers", columns: table => new { TenantId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(128)", maxLength: 128, nullable: false), TempId1 = table.Column(type: "uniqueidentifier", nullable: false), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) }, constraints: table => { table.UniqueConstraint("AK_AbpBlobContainers_TempId1", x => x.TempId1); }); migrationBuilder.CreateTable( name: "AbpBlobs", columns: table => new { ContainerId = table.Column(type: "uniqueidentifier", nullable: false), TenantId = table.Column(type: "uniqueidentifier", nullable: true), Name = table.Column(type: "nvarchar(256)", maxLength: 256, nullable: false), Content = table.Column(type: "varbinary(max)", maxLength: 2147483647, nullable: true), ExtraProperties = table.Column(type: "nvarchar(max)", nullable: true), ConcurrencyStamp = table.Column(type: "nvarchar(40)", maxLength: 40, nullable: true) }, constraints: table => { table.ForeignKey( name: "FK_AbpBlobs_AbpBlobContainers_ContainerId", column: x => x.ContainerId, principalTable: "AbpBlobContainers", principalColumn: "TempId1", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_AbpBlobContainers_TenantId_Name", table: "AbpBlobContainers", columns: new[] { "TenantId", "Name" }); migrationBuilder.CreateIndex( name: "IX_AbpBlobs_TenantId_ContainerId_Name", table: "AbpBlobs", columns: new[] { "TenantId", "ContainerId", "Name" }); } } }