|
|
@@ -0,0 +1,102 @@
|
|
|
+using System;
|
|
|
+using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
+
|
|
|
+namespace Warhammer.Migrations
|
|
|
+{
|
|
|
+ public partial class newMigration : Migration
|
|
|
+ {
|
|
|
+ protected override void Up(MigrationBuilder migrationBuilder)
|
|
|
+ {
|
|
|
+
|
|
|
+ migrationBuilder.CreateTable(
|
|
|
+ name: "Weapon",
|
|
|
+ columns: table => new
|
|
|
+ {
|
|
|
+ Id = table.Column<int>(nullable: false)
|
|
|
+ .Annotation("SqlServer:Identity", "1, 1"),
|
|
|
+ CreatedDate = table.Column<DateTime>(nullable: false),
|
|
|
+ ModifiedDate = table.Column<DateTime>(nullable: false),
|
|
|
+ Range = table.Column<int>(nullable: false),
|
|
|
+ Name = table.Column<string>(nullable: true),
|
|
|
+ GPE = table.Column<string>(nullable: true),
|
|
|
+ Type = table.Column<string>(nullable: true),
|
|
|
+ Pene = table.Column<int>(nullable: false),
|
|
|
+ Mode = table.Column<string>(nullable: true),
|
|
|
+ At = table.Column<string>(nullable: true),
|
|
|
+ Rch = table.Column<string>(nullable: true),
|
|
|
+ Attribute = table.Column<string>(nullable: true),
|
|
|
+ PlayerId = table.Column<int>(nullable: true)
|
|
|
+ },
|
|
|
+ constraints: table =>
|
|
|
+ {
|
|
|
+ table.PrimaryKey("PK_Weapon", x => x.Id);
|
|
|
+ });
|
|
|
+
|
|
|
+ migrationBuilder.CreateTable(
|
|
|
+ name: "Players",
|
|
|
+ columns: table => new
|
|
|
+ {
|
|
|
+ Id = table.Column<int>(nullable: false)
|
|
|
+ .Annotation("SqlServer:Identity", "1, 1"),
|
|
|
+ CreatedDate = table.Column<DateTime>(nullable: false),
|
|
|
+ ModifiedDate = table.Column<DateTime>(nullable: false),
|
|
|
+ Name = table.Column<string>(nullable: true),
|
|
|
+ CharacterName = table.Column<string>(nullable: true),
|
|
|
+ Background = table.Column<string>(nullable: true),
|
|
|
+ Experience = table.Column<int>(nullable: false),
|
|
|
+ CC = table.Column<int>(nullable: false),
|
|
|
+ CT = table.Column<int>(nullable: false),
|
|
|
+ F = table.Column<int>(nullable: false),
|
|
|
+ E = table.Column<int>(nullable: false),
|
|
|
+ AG = table.Column<int>(nullable: false),
|
|
|
+ INT = table.Column<int>(nullable: false),
|
|
|
+ PER = table.Column<int>(nullable: false),
|
|
|
+ FM = table.Column<int>(nullable: false),
|
|
|
+ SOC = table.Column<int>(nullable: false),
|
|
|
+ MF = table.Column<int>(nullable: false),
|
|
|
+ WeaponId = table.Column<int>(nullable: true)
|
|
|
+ },
|
|
|
+ constraints: table =>
|
|
|
+ {
|
|
|
+ table.PrimaryKey("PK_Players", x => x.Id);
|
|
|
+ table.ForeignKey(
|
|
|
+ name: "FK_Players_Weapon_WeaponId",
|
|
|
+ column: x => x.WeaponId,
|
|
|
+ principalTable: "Weapon",
|
|
|
+ principalColumn: "Id",
|
|
|
+ onDelete: ReferentialAction.Restrict);
|
|
|
+ });
|
|
|
+
|
|
|
+ migrationBuilder.CreateIndex(
|
|
|
+ name: "IX_Players_WeaponId",
|
|
|
+ table: "Players",
|
|
|
+ column: "WeaponId");
|
|
|
+
|
|
|
+ migrationBuilder.CreateIndex(
|
|
|
+ name: "IX_Weapon_PlayerId",
|
|
|
+ table: "Weapon",
|
|
|
+ column: "PlayerId");
|
|
|
+
|
|
|
+ migrationBuilder.AddForeignKey(
|
|
|
+ name: "FK_Weapon_Players_PlayerId",
|
|
|
+ table: "Weapon",
|
|
|
+ column: "PlayerId",
|
|
|
+ principalTable: "Players",
|
|
|
+ principalColumn: "Id",
|
|
|
+ onDelete: ReferentialAction.Restrict);
|
|
|
+ }
|
|
|
+
|
|
|
+ protected override void Down(MigrationBuilder migrationBuilder)
|
|
|
+ {
|
|
|
+ migrationBuilder.DropForeignKey(
|
|
|
+ name: "FK_Players_Weapon_WeaponId",
|
|
|
+ table: "Players");
|
|
|
+
|
|
|
+ migrationBuilder.DropTable(
|
|
|
+ name: "Weapon");
|
|
|
+
|
|
|
+ migrationBuilder.DropTable(
|
|
|
+ name: "Players");
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|