using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace PetCompanion.Migrations { /// public partial class Initial : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Pets", columns: table => new { Id = table.Column(type: "TEXT", nullable: false), Name = table.Column(type: "TEXT", nullable: false), Class = table.Column(type: "INTEGER", nullable: false), Level = table.Column(type: "INTEGER", nullable: false), UserId = table.Column(type: "TEXT", nullable: false), IsDead = table.Column(type: "INTEGER", nullable: false), PetGatherAction = table.Column(type: "INTEGER", nullable: false), GatherActionSince = table.Column(type: "TEXT", nullable: false), PetBasicAction = table.Column(type: "INTEGER", nullable: false), BasicActionCooldown = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Pets", x => x.Id); }); migrationBuilder.CreateTable( name: "PetStats", columns: table => new { PetId = table.Column(type: "TEXT", nullable: false), Intelligence = table.Column(type: "INTEGER", nullable: false), Strength = table.Column(type: "INTEGER", nullable: false), Charisma = table.Column(type: "INTEGER", nullable: false), MaxIntelligence = table.Column(type: "INTEGER", nullable: false), MaxStrength = table.Column(type: "INTEGER", nullable: false), MaxCharisma = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PetStats", x => x.PetId); table.ForeignKey( name: "FK_PetStats_Pets_PetId", column: x => x.PetId, principalTable: "Pets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Resources", columns: table => new { PetId = table.Column(type: "TEXT", nullable: false), Wisdom = table.Column(type: "INTEGER", nullable: false), Gold = table.Column(type: "INTEGER", nullable: false), Food = table.Column(type: "INTEGER", nullable: false), Junk = table.Column(type: "INTEGER", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Resources", x => x.PetId); table.ForeignKey( name: "FK_Resources_Pets_PetId", column: x => x.PetId, principalTable: "Pets", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PetStats"); migrationBuilder.DropTable( name: "Resources"); migrationBuilder.DropTable( name: "Pets"); } } }