using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DataLayer.Migrations { /// public partial class InitialCreate : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Players", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: true), CharacterName = table.Column(type: "nvarchar(max)", nullable: true), Background = table.Column(type: "nvarchar(max)", nullable: true), Experience = table.Column(type: "int", nullable: false), CC = table.Column(type: "int", nullable: false), CT = table.Column(type: "int", nullable: false), F = table.Column(type: "int", nullable: false), E = table.Column(type: "int", nullable: false), AG = table.Column(type: "int", nullable: false), INT = table.Column(type: "int", nullable: false), PER = table.Column(type: "int", nullable: false), FM = table.Column(type: "int", nullable: false), SOC = table.Column(type: "int", nullable: false), MF = table.Column(type: "int", nullable: false), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Players", x => x.Id); }); migrationBuilder.CreateTable( name: "Weapons", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Range = table.Column(type: "int", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: true), GPE = table.Column(type: "nvarchar(max)", nullable: true), Type = table.Column(type: "nvarchar(max)", nullable: true), Pene = table.Column(type: "int", nullable: false), Mode = table.Column(type: "nvarchar(max)", nullable: true), At = table.Column(type: "nvarchar(max)", nullable: true), Rch = table.Column(type: "nvarchar(max)", nullable: true), Attribute = table.Column(type: "nvarchar(max)", nullable: true), CreatedDate = table.Column(type: "datetime2", nullable: false), ModifiedDate = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Weapons", x => x.Id); }); migrationBuilder.CreateTable( name: "PlayerWeapon", columns: table => new { PlayersId = table.Column(type: "int", nullable: false), WeaponsId = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlayerWeapon", x => new { x.PlayersId, x.WeaponsId }); table.ForeignKey( name: "FK_PlayerWeapon_Players_PlayersId", column: x => x.PlayersId, principalTable: "Players", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlayerWeapon_Weapons_WeaponsId", column: x => x.WeaponsId, principalTable: "Weapons", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_PlayerWeapon_WeaponsId", table: "PlayerWeapon", column: "WeaponsId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "PlayerWeapon"); migrationBuilder.DropTable( name: "Players"); migrationBuilder.DropTable( name: "Weapons"); } } }