using Microsoft.EntityFrameworkCore.Migrations; namespace SessionCompanion.Database.Migrations { public partial class Usernamecolumnrename : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.RenameColumn( name: "Nickname", table: "Users", newName: "Username"); migrationBuilder.CreateTable( name: "Charismas", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false), Deception = table.Column(type: "int", nullable: false), CanDeception = table.Column(type: "bit", nullable: false), Intimidation = table.Column(type: "int", nullable: false), CanIntimidation = table.Column(type: "bit", nullable: false), Performance = table.Column(type: "int", nullable: false), CanPerformance = table.Column(type: "bit", nullable: false), Persuasion = table.Column(type: "int", nullable: false), CanPersuasion = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Charismas", x => x.Id); table.ForeignKey( name: "FK_Charismas_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Constitutions", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Constitutions", x => x.Id); table.ForeignKey( name: "FK_Constitutions_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Dexterities", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false), Acrobatics = table.Column(type: "int", nullable: false), CanAcrobatics = table.Column(type: "bit", nullable: false), SleightOfHand = table.Column(type: "int", nullable: false), CanSleightOfHand = table.Column(type: "bit", nullable: false), Stealth = table.Column(type: "int", nullable: false), CanStealth = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Dexterities", x => x.Id); table.ForeignKey( name: "FK_Dexterities_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Intelligences", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false), Arcana = table.Column(type: "int", nullable: false), CanArcana = table.Column(type: "bit", nullable: false), History = table.Column(type: "int", nullable: false), CanHistory = table.Column(type: "bit", nullable: false), Investigation = table.Column(type: "int", nullable: false), CanInvestigation = table.Column(type: "bit", nullable: false), Nature = table.Column(type: "int", nullable: false), CanNature = table.Column(type: "bit", nullable: false), Religion = table.Column(type: "int", nullable: false), CanReligion = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Intelligences", x => x.Id); table.ForeignKey( name: "FK_Intelligences_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Strengths", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false), Athletics = table.Column(type: "int", nullable: false), CanAthletics = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Strengths", x => x.Id); table.ForeignKey( name: "FK_Strengths_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( name: "Wisdoms", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), CharacterId = table.Column(type: "int", nullable: false), Value = table.Column(type: "int", nullable: false), Modification = table.Column(type: "int", nullable: false), SavingThrows = table.Column(type: "int", nullable: false), CanSaveThrows = table.Column(type: "bit", nullable: false), AnimalHandling = table.Column(type: "int", nullable: false), CanAnimalHandling = table.Column(type: "bit", nullable: false), Insight = table.Column(type: "int", nullable: false), CanInsight = table.Column(type: "bit", nullable: false), Medicine = table.Column(type: "int", nullable: false), CanMedicine = table.Column(type: "bit", nullable: false), Perception = table.Column(type: "int", nullable: false), CanPerception = table.Column(type: "bit", nullable: false), Survival = table.Column(type: "int", nullable: false), CanSurvival = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Wisdoms", x => x.Id); table.ForeignKey( name: "FK_Wisdoms_Characters_CharacterId", column: x => x.CharacterId, principalTable: "Characters", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_Charismas_CharacterId", table: "Charismas", column: "CharacterId", unique: true); migrationBuilder.CreateIndex( name: "IX_Constitutions_CharacterId", table: "Constitutions", column: "CharacterId", unique: true); migrationBuilder.CreateIndex( name: "IX_Dexterities_CharacterId", table: "Dexterities", column: "CharacterId", unique: true); migrationBuilder.CreateIndex( name: "IX_Intelligences_CharacterId", table: "Intelligences", column: "CharacterId", unique: true); migrationBuilder.CreateIndex( name: "IX_Strengths_CharacterId", table: "Strengths", column: "CharacterId", unique: true); migrationBuilder.CreateIndex( name: "IX_Wisdoms_CharacterId", table: "Wisdoms", column: "CharacterId", unique: true); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Charismas"); migrationBuilder.DropTable( name: "Constitutions"); migrationBuilder.DropTable( name: "Dexterities"); migrationBuilder.DropTable( name: "Intelligences"); migrationBuilder.DropTable( name: "Strengths"); migrationBuilder.DropTable( name: "Wisdoms"); migrationBuilder.RenameColumn( name: "Username", table: "Users", newName: "Nickname"); } } }