using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Kehyeedra3.Migrations { public partial class store : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "StoreFronts", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserId = table.Column(nullable: false), StoreItemType = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_StoreFronts", x => x.Id); }); migrationBuilder.CreateTable( name: "StoreInventory", columns: table => new { InvId = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Item = table.Column(nullable: true), Amount = table.Column(nullable: false), Price = table.Column(nullable: false), StoreFrontId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_StoreInventory", x => x.InvId); table.ForeignKey( name: "FK_StoreInventory_StoreFronts_StoreFrontId", column: x => x.StoreFrontId, principalTable: "StoreFronts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_StoreInventory_StoreFrontId", table: "StoreInventory", column: "StoreFrontId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "StoreInventory"); migrationBuilder.DropTable( name: "StoreFronts"); } } }