using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class FactionWeapons : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "FactionWeapons", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FactionId = table.Column(nullable: false), WeaponModel = table.Column(nullable: true), SlotID = table.Column(nullable: false), Rank = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_FactionWeapons", x => x.Id); table.ForeignKey( name: "FK_FactionWeapons_Factions_FactionId", column: x => x.FactionId, principalTable: "Factions", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_FactionWeapons_FactionId", table: "FactionWeapons", column: "FactionId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "FactionWeapons"); } } }