fix house

This commit is contained in:
hydrant
2019-07-16 20:42:05 +02:00
parent 976c285662
commit 3082b0bab2
10 changed files with 2606 additions and 19 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,61 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class BusRoutes : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "BusRoutes",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Description = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BusRoutes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "BusRoutesPoints",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Description = table.Column<string>(nullable: true),
X = table.Column<float>(nullable: false),
Y = table.Column<float>(nullable: false),
Z = table.Column<float>(nullable: false),
BusRouteId = table.Column<int>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_BusRoutesPoints", x => x.Id);
table.ForeignKey(
name: "FK_BusRoutesPoints_BusRoutes_BusRouteId",
column: x => x.BusRouteId,
principalTable: "BusRoutes",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateIndex(
name: "IX_BusRoutesPoints_BusRouteId",
table: "BusRoutesPoints",
column: "BusRouteId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "BusRoutesPoints");
migrationBuilder.DropTable(
name: "BusRoutes");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,43 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class UserHouseReferenceFix : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "OwnerId",
table: "Houses",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Houses_OwnerId",
table: "Houses",
column: "OwnerId");
migrationBuilder.AddForeignKey(
name: "FK_Houses_Users_OwnerId",
table: "Houses",
column: "OwnerId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Houses_Users_OwnerId",
table: "Houses");
migrationBuilder.DropIndex(
name: "IX_Houses_OwnerId",
table: "Houses");
migrationBuilder.DropColumn(
name: "OwnerId",
table: "Houses");
}
}
}

View File

@@ -61,6 +61,40 @@ namespace ReallifeGamemode.Migrations
b.ToTable("Bans");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoute", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Description");
b.HasKey("Id");
b.ToTable("BusRoutes");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoutePoint", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("BusRouteId");
b.Property<string>("Description");
b.Property<float>("X");
b.Property<float>("Y");
b.Property<float>("Z");
b.HasKey("Id");
b.HasIndex("BusRouteId");
b.ToTable("BusRoutesPoints");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusinessBankAccount", b =>
{
b.Property<int>("Id")
@@ -409,12 +443,12 @@ namespace ReallifeGamemode.Migrations
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<int?>("OwnerId");
b.Property<int>("Price");
b.Property<string>("Type");
b.Property<int?>("UserId");
b.Property<float>("X");
b.Property<float>("Y");
@@ -423,7 +457,7 @@ namespace ReallifeGamemode.Migrations
b.HasKey("Id");
b.HasIndex("UserId");
b.HasIndex("OwnerId");
b.ToTable("Houses");
});
@@ -828,6 +862,8 @@ namespace ReallifeGamemode.Migrations
b.Property<string>("SocialClubName")
.HasMaxLength(32);
b.Property<int>("Wage");
b.Property<int>("Wanteds");
b.HasKey("Id");
@@ -999,6 +1035,13 @@ namespace ReallifeGamemode.Migrations
.OnDelete(DeleteBehavior.Cascade);
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.BusRoutePoint", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.BusRoute", "BusRoute")
.WithMany("RoutePoints")
.HasForeignKey("BusRouteId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Character", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
@@ -1055,9 +1098,9 @@ namespace ReallifeGamemode.Migrations
modelBuilder.Entity("ReallifeGamemode.Server.Entities.House", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")
b.HasOne("ReallifeGamemode.Server.Entities.User", "Owner")
.WithMany()
.HasForeignKey("UserId");
.HasForeignKey("OwnerId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.Death", b =>