using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Kehyeedra3.Migrations { public partial class RodUpdate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "RodOwned", table: "Fishing", nullable: false, defaultValue: (byte)0); migrationBuilder.AddColumn( name: "RodUsed", table: "Fishing", nullable: false, defaultValue: (byte)0); migrationBuilder.CreateTable( name: "ItemOffer", columns: table => new { OfferId = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), BuyerId = table.Column(nullable: false), StoreId = table.Column(nullable: false), ItemId = table.Column(nullable: false), Amount = table.Column(nullable: false), OfferAmount = table.Column(nullable: false), IsPurchaseFromStore = table.Column(nullable: false), IsSellOffer = table.Column(nullable: false), StoreFrontId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_ItemOffer", x => x.OfferId); table.ForeignKey( name: "FK_ItemOffer_StoreFronts_StoreFrontId", column: x => x.StoreFrontId, principalTable: "StoreFronts", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_ItemOffer_StoreFrontId", table: "ItemOffer", column: "StoreFrontId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "ItemOffer"); migrationBuilder.DropColumn( name: "RodOwned", table: "Fishing"); migrationBuilder.DropColumn( name: "RodUsed", table: "Fishing"); } } }