Change vehicle taxation

see https://life-of-german.org/bugtracker/bug/60-neue-fahrzeugsteuern/

@hydrant update DB before merge with master.
This commit is contained in:
2021-04-21 21:32:19 +02:00
parent 8485102e49
commit 4fe9365902
5 changed files with 2331 additions and 12 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,109 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace ReallifeGamemode.Database.Migrations
{
public partial class UserVehicleBusinessId : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs");
migrationBuilder.AddColumn<int>(
name: "UserVehicle_BusinessId",
table: "ServerVehicles",
nullable: true);
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "ChatLogs",
nullable: false,
oldClrType: typeof(int),
oldType: "int",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs",
column: "UserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs",
column: "FactionId",
principalTable: "Factions",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs",
column: "GroupId",
principalTable: "Groups",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs");
migrationBuilder.DropForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs");
migrationBuilder.DropColumn(
name: "UserVehicle_BusinessId",
table: "ServerVehicles");
migrationBuilder.AlterColumn<int>(
name: "UserId",
table: "ChatLogs",
type: "int",
nullable: true,
oldClrType: typeof(int));
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Users_UserId",
table: "ChatLogs",
column: "UserId",
principalTable: "Users",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Factions_FactionId",
table: "ChatLogs",
column: "FactionId",
principalTable: "Factions",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
migrationBuilder.AddForeignKey(
name: "FK_ChatLogs_Groups_GroupId",
table: "ChatLogs",
column: "GroupId",
principalTable: "Groups",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
}
}

View File

@@ -814,7 +814,7 @@ namespace ReallifeGamemode.Database.Migrations
.ValueGeneratedOnAdd()
.HasColumnType("datetime(6)");
b.Property<int?>("UserId")
b.Property<int>("UserId")
.HasColumnType("int");
b.HasKey("Id");
@@ -1749,7 +1749,7 @@ namespace ReallifeGamemode.Database.Migrations
{
b.HasBaseType("ReallifeGamemode.Database.Entities.Logs.Chat.ChatLogEntry");
b.Property<int?>("FactionId")
b.Property<int>("FactionId")
.HasColumnType("int");
b.HasIndex("FactionId");
@@ -1768,7 +1768,7 @@ namespace ReallifeGamemode.Database.Migrations
{
b.HasBaseType("ReallifeGamemode.Database.Entities.Logs.Chat.ChatLogEntry");
b.Property<int?>("GroupId")
b.Property<int>("GroupId")
.HasColumnType("int");
b.HasIndex("GroupId");
@@ -1891,6 +1891,10 @@ namespace ReallifeGamemode.Database.Migrations
{
b.HasBaseType("ReallifeGamemode.Database.Entities.ServerVehicle");
b.Property<int?>("BusinessId")
.HasColumnName("UserVehicle_BusinessId")
.HasColumnType("int");
b.Property<int?>("Price")
.HasColumnName("UserVehicle_Price")
.HasColumnType("int");
@@ -2011,7 +2015,9 @@ namespace ReallifeGamemode.Database.Migrations
{
b.HasOne("ReallifeGamemode.Database.Entities.User", "User")
.WithMany()
.HasForeignKey("UserId");
.HasForeignKey("UserId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.CommandLogEntry", b =>
@@ -2134,14 +2140,18 @@ namespace ReallifeGamemode.Database.Migrations
{
b.HasOne("ReallifeGamemode.Database.Entities.Faction", "Faction")
.WithMany()
.HasForeignKey("FactionId");
.HasForeignKey("FactionId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.Logs.Chat.GroupChatLogEntry", b =>
{
b.HasOne("ReallifeGamemode.Database.Entities.Group", "Group")
.WithMany()
.HasForeignKey("GroupId");
.HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
});
modelBuilder.Entity("ReallifeGamemode.Database.Entities.GroupVehicle", b =>