using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace ReallifeGamemode.Database.Migrations
{
  public partial class VehicleItems : Migration
  {
    protected override void Up(MigrationBuilder migrationBuilder)
    {

      migrationBuilder.CreateTable(
          name: "VehicleItems",
          columns: table => new
          {
            Id = table.Column<int>(nullable: false)
                  .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
            ItemId = table.Column<int>(nullable: false),
            VehicleId = table.Column<int>(nullable: false),
            Amount = table.Column<int>(nullable: false),
            Slot = table.Column<int>(nullable: false)
          },
          constraints: table =>
          {
            table.PrimaryKey("PK_VehicleItems", x => x.Id);
            table.ForeignKey(
                      name: "FK_VehicleItems_ServerVehicles_VehicleId",
                      column: x => x.VehicleId,
                      principalTable: "ServerVehicles",
                      principalColumn: "Id",
                      onDelete: ReferentialAction.Cascade);
          });

      migrationBuilder.CreateIndex(
          name: "IX_VehicleItems_VehicleId",
          table: "VehicleItems",
          column: "VehicleId");


    }

    protected override void Down(MigrationBuilder migrationBuilder)
    {

      migrationBuilder.DropTable(
          name: "VehicleItems");


    }
  }
}
