using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace Kehyeedra3.Migrations { public partial class basedmigration : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Fishing", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), LastFish = table.Column(nullable: false), Xp = table.Column(nullable: false), TXp = table.Column(nullable: false), Lvl = table.Column(nullable: false), RodOwned = table.Column(nullable: false), RodUsed = table.Column(nullable: false), Prestige = table.Column(nullable: false), Inventory = table.Column(type: "LONGTEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Fishing", x => x.Id); }); migrationBuilder.CreateTable( name: "Reminders", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Created = table.Column(nullable: false), Send = table.Column(nullable: false), UserId = table.Column(nullable: false), Message = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Reminders", x => x.Id); }); 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: "Users", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Avatar = table.Column(nullable: true), Username = table.Column(nullable: true), Money = table.Column(nullable: false), LastMine = table.Column(nullable: false), GeneralInventory = table.Column(type: "LONGTEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); }); 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.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.CreateTable( name: "BattleFishObject", columns: table => new { FishId = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FishType = table.Column(nullable: false), Xp = table.Column(nullable: false), NextXp = table.Column(nullable: false), Lvl = table.Column(nullable: false), Name = table.Column(nullable: true), UserId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_BattleFishObject", x => x.FishId); table.ForeignKey( name: "FK_BattleFishObject_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateIndex( name: "IX_BattleFishObject_UserId", table: "BattleFishObject", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_ItemOffer_StoreFrontId", table: "ItemOffer", column: "StoreFrontId"); migrationBuilder.CreateIndex( name: "IX_StoreInventory_StoreFrontId", table: "StoreInventory", column: "StoreFrontId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "BattleFishObject"); migrationBuilder.DropTable( name: "Fishing"); migrationBuilder.DropTable( name: "ItemOffer"); migrationBuilder.DropTable( name: "Reminders"); migrationBuilder.DropTable( name: "StoreInventory"); migrationBuilder.DropTable( name: "Users"); migrationBuilder.DropTable( name: "StoreFronts"); } } }