Add House Menu

This commit is contained in:
hydrant
2019-07-28 20:43:23 +02:00
parent f86bbe01c6
commit 5b9c08011e
12 changed files with 1686 additions and 12 deletions

View File

@@ -0,0 +1,73 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class HouseEnhancments : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<bool>(
name: "CanRentIn",
table: "Houses",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<int>(
name: "RentalFee",
table: "Houses",
nullable: false,
defaultValue: 0);
migrationBuilder.CreateTable(
name: "HouseRentals",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
HouseId = table.Column<int>(nullable: true),
UserId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_HouseRentals", x => x.Id);
table.ForeignKey(
name: "FK_HouseRentals_Houses_HouseId",
column: x => x.HouseId,
principalTable: "Houses",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
table.ForeignKey(
name: "FK_HouseRentals_Users_UserId",
column: x => x.UserId,
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_HouseRentals_HouseId",
table: "HouseRentals",
column: "HouseId");
migrationBuilder.CreateIndex(
name: "IX_HouseRentals_UserId",
table: "HouseRentals",
column: "UserId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "HouseRentals");
migrationBuilder.DropColumn(
name: "CanRentIn",
table: "Houses");
migrationBuilder.DropColumn(
name: "RentalFee",
table: "Houses");
}
}
}