converted jobs to same system as businesses, add option to choose job at cityhall

This commit is contained in:
hydrant
2019-05-16 14:52:19 +02:00
parent 8fd4041b3c
commit aa81fa95a4
18 changed files with 1422 additions and 59 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Migrations
{
public partial class JobFix : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ServerVehicles_Jobs_JobId",
table: "ServerVehicles");
migrationBuilder.DropForeignKey(
name: "FK_Users_Jobs_JobId",
table: "Users");
migrationBuilder.DropTable(
name: "Jobs");
migrationBuilder.DropIndex(
name: "IX_Users_JobId",
table: "Users");
migrationBuilder.DropIndex(
name: "IX_ServerVehicles_JobId",
table: "ServerVehicles");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Jobs",
columns: table => new
{
Id = table.Column<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Name = table.Column<string>(nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Jobs", x => x.Id);
});
migrationBuilder.CreateIndex(
name: "IX_Users_JobId",
table: "Users",
column: "JobId");
migrationBuilder.CreateIndex(
name: "IX_ServerVehicles_JobId",
table: "ServerVehicles",
column: "JobId");
migrationBuilder.AddForeignKey(
name: "FK_ServerVehicles_Jobs_JobId",
table: "ServerVehicles",
column: "JobId",
principalTable: "Jobs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_Users_Jobs_JobId",
table: "Users",
column: "JobId",
principalTable: "Jobs",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -420,18 +420,6 @@ namespace ReallifeGamemode.Migrations
b.ToTable("Interiors");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Job", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Name");
b.HasKey("Id");
b.ToTable("Jobs");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.Logs.BankAccountTransactionHistory", b =>
{
b.Property<int>("Id")
@@ -827,8 +815,6 @@ namespace ReallifeGamemode.Migrations
b.HasIndex("GroupId");
b.HasIndex("JobId");
b.ToTable("Users");
});
@@ -935,9 +921,7 @@ namespace ReallifeGamemode.Migrations
{
b.HasBaseType("ReallifeGamemode.Server.Entities.ServerVehicle");
b.Property<int?>("JobId");
b.HasIndex("JobId");
b.Property<int>("JobId");
b.HasDiscriminator().HasValue("JobVehicle");
});
@@ -957,8 +941,6 @@ namespace ReallifeGamemode.Migrations
b.Property<int>("Price");
b.Property<int?>("ShopId");
b.ToTable("ShopVehicles");
b.HasDiscriminator().HasValue("ShopVehicle");
@@ -1079,10 +1061,6 @@ namespace ReallifeGamemode.Migrations
b.HasOne("ReallifeGamemode.Server.Entities.Group", "Group")
.WithMany()
.HasForeignKey("GroupId");
b.HasOne("ReallifeGamemode.Server.Entities.Job", "Job")
.WithMany()
.HasForeignKey("JobId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserBankAccount", b =>
@@ -1123,13 +1101,6 @@ namespace ReallifeGamemode.Migrations
.HasForeignKey("GroupId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.JobVehicle", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.Job", "Job")
.WithMany()
.HasForeignKey("JobId");
});
modelBuilder.Entity("ReallifeGamemode.Server.Entities.UserVehicle", b =>
{
b.HasOne("ReallifeGamemode.Server.Entities.User", "User")