add house entity
This commit is contained in:
1148
ReallifeGamemode.Server/Migrations/20190626193631_House.Designer.cs
generated
Normal file
1148
ReallifeGamemode.Server/Migrations/20190626193631_House.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
53
ReallifeGamemode.Server/Migrations/20190626193631_House.cs
Normal file
53
ReallifeGamemode.Server/Migrations/20190626193631_House.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Microsoft.EntityFrameworkCore.Metadata;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace ReallifeGamemode.Migrations
|
||||
{
|
||||
public partial class House : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<int>(
|
||||
name: "HouseId",
|
||||
table: "Users",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "Houses",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<int>(nullable: false)
|
||||
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
|
||||
Type = table.Column<string>(nullable: true),
|
||||
Price = table.Column<int>(nullable: false),
|
||||
UserId = table.Column<int>(nullable: true)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_Houses", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_Houses_Users_UserId",
|
||||
column: x => x.UserId,
|
||||
principalTable: "Users",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Houses_UserId",
|
||||
table: "Houses",
|
||||
column: "UserId",
|
||||
unique: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropTable(
|
||||
name: "Houses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "HouseId",
|
||||
table: "Users");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -404,6 +404,25 @@ namespace ReallifeGamemode.Migrations
|
||||
b.ToTable("GroupBankAccounts");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.House", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<int>("Price");
|
||||
|
||||
b.Property<string>("Type");
|
||||
|
||||
b.Property<int?>("UserId");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("UserId")
|
||||
.IsUnique();
|
||||
|
||||
b.ToTable("Houses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Interior", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
@@ -780,6 +799,8 @@ namespace ReallifeGamemode.Migrations
|
||||
|
||||
b.Property<int>("Handmoney");
|
||||
|
||||
b.Property<int?>("HouseId");
|
||||
|
||||
b.Property<int?>("JobId");
|
||||
|
||||
b.Property<int>("LogUserId");
|
||||
@@ -1025,6 +1046,13 @@ namespace ReallifeGamemode.Migrations
|
||||
.HasForeignKey("GroupId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.House", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
|
||||
.WithOne("House")
|
||||
.HasForeignKey("ReallifeGamemode.Server.Entities.House", "UserId");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.Death", b =>
|
||||
{
|
||||
b.HasOne("ReallifeGamemode.Server.Entities.User", "Killer")
|
||||
|
||||
Reference in New Issue
Block a user