diff --git a/.gitignore b/.gitignore index 88f5619d..4d13c548 100644 --- a/.gitignore +++ b/.gitignore @@ -332,7 +332,3 @@ ASALocalRun/ # Local History for Visual Studio .localhistory/ - -# Migrations Folder -Migrations/ -/Properties/launchSettings.json diff --git a/ReallifeGamemode.Server/Migrations/20190226185806_Initial.Designer.cs b/ReallifeGamemode.Server/Migrations/20190226185806_Initial.Designer.cs new file mode 100644 index 00000000..43a6f29c --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190226185806_Initial.Designer.cs @@ -0,0 +1,1000 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using reallife_gamemode.Server.Models; + +namespace ReallifeGamemode.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20190226185806_Initial")] + partial class Initial + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Applied"); + + b.Property("BannedBy"); + + b.Property("Reason"); + + b.Property("UntilDateTime"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Balance"); + + b.Property("BusinessId"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Ageing"); + + b.Property("AgeingOpacity"); + + b.Property("BeardColor"); + + b.Property("Blemishes"); + + b.Property("BlemishesOpacity"); + + b.Property("Blush"); + + b.Property("BlushColor"); + + b.Property("BlushOpacity"); + + b.Property("BrowDepth"); + + b.Property("BrowHeight"); + + b.Property("CheekDepth"); + + b.Property("CheekboneHeight"); + + b.Property("CheekboneWidth"); + + b.Property("ChestHair"); + + b.Property("ChestHairColor"); + + b.Property("ChestHairOpacity"); + + b.Property("ChinDepth"); + + b.Property("ChinHeight"); + + b.Property("ChinIndent"); + + b.Property("ChinWidth"); + + b.Property("Complexion"); + + b.Property("ComplexionOpacity"); + + b.Property("EyeColor"); + + b.Property("EyeSize"); + + b.Property("EyebrowColor"); + + b.Property("Eyebrows"); + + b.Property("EyebrowsOpacity"); + + b.Property("FacialHair"); + + b.Property("FacialHairOpacity"); + + b.Property("Father"); + + b.Property("Freckles"); + + b.Property("FrecklesOpacity"); + + b.Property("Gender"); + + b.Property("Hair"); + + b.Property("HairColor"); + + b.Property("HairHighlightColor"); + + b.Property("JawShape"); + + b.Property("JawWidth"); + + b.Property("LipThickness"); + + b.Property("Lipstick"); + + b.Property("LipstickColor"); + + b.Property("LipstickOpacity"); + + b.Property("Makeup"); + + b.Property("MakeupOpacity"); + + b.Property("Mother"); + + b.Property("NeckWidth"); + + b.Property("NoseBottomHeight"); + + b.Property("NoseBridgeDepth"); + + b.Property("NoseBroken"); + + b.Property("NoseTipHeight"); + + b.Property("NoseTipLength"); + + b.Property("NoseWidth"); + + b.Property("Similarity"); + + b.Property("SkinSimilarity"); + + b.Property("SunDamage"); + + b.Property("SunDamageOpacity"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("Duty"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Gender"); + + b.Property("Top"); + + b.Property("Torso"); + + b.Property("Undershirt"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Category"); + + b.Property("FactionId"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("Name"); + + b.Property("Radius"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("FactionId"); + + b.Property("Gender"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("StateOwned"); + + b.HasKey("Id"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("FactionId"); + + b.Property("Iban") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FactionId"); + + b.Property("Order"); + + b.Property("RankName"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Description") + .HasMaxLength(32); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Caption"); + + b.Property("Content"); + + b.Property("Timestamp"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired(); + + b.Property("Heading"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("NumberPlate") + .HasMaxLength(8); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("PrimaryColor"); + + b.Property("SecondaryColor"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AdminLevel"); + + b.Property("BanId"); + + b.Property("BusinessId"); + + b.Property("CharacterId"); + + b.Property("Dead"); + + b.Property("Email") + .HasMaxLength(64); + + b.Property("FactionId"); + + b.Property("FactionLeader"); + + b.Property("FactionRankId"); + + b.Property("LogUserId"); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("Password") + .HasMaxLength(64); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("Iban") + .HasMaxLength(32); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Amount"); + + b.Property("ItemId"); + + b.Property("Slot"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ModId"); + + b.Property("ServerVehicleId"); + + b.Property("Slot"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Fee"); + + b.Property("MoneySent"); + + b.Property("NewReceiverBalance"); + + b.Property("NewSenderBalance"); + + b.Property("Origin") + .HasMaxLength(32); + + b.Property("Receiver") + .HasMaxLength(32); + + b.Property("ReceiverBalance"); + + b.Property("Sender") + .HasMaxLength(32); + + b.Property("SenderBalance"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CauseOfDeath") + .HasMaxLength(64); + + b.Property("KillerHeading"); + + b.Property("KillerId"); + + b.Property("KillerPositionX"); + + b.Property("KillerPositionY"); + + b.Property("KillerPositionZ"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.Property("VictimHeading"); + + b.Property("VictimId"); + + b.Property("VictimPositionX"); + + b.Property("VictimPositionY"); + + b.Property("VictimPositionZ"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Alpha"); + + b.Property("Color"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Name"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Rotation"); + + b.Property("Scale"); + + b.Property("ShortRange"); + + b.Property("Sprite"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DirectionX"); + + b.Property("DirectionY"); + + b.Property("DirectionZ"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Scale"); + + b.Property("Type"); + + b.Property("Visible"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("HashModel"); + + b.Property("Heading"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("PositionX") + .HasMaxLength(128); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RespawnTime"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Vehicle"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Font"); + + b.Property("LOS"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Text") + .IsRequired(); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("FactionId"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ShopVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("BusinessId"); + + b.Property("Price"); + + b.Property("ShopId"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Ban", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Character", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.CharacterCloth", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Door", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.DutyCloth", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionBankAccount", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionRank", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.News", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.User", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("reallife_gamemode.Server.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("reallife_gamemode.Server.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserBankAccount", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserItem", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.VehicleMod", b => + { + b.HasOne("reallife_gamemode.Server.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.Death", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("reallife_gamemode.Server.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionVehicle", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserVehicle", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/ReallifeGamemode.Server/Migrations/20190226185806_Initial.cs b/ReallifeGamemode.Server/Migrations/20190226185806_Initial.cs new file mode 100644 index 00000000..730f3261 --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/20190226185806_Initial.cs @@ -0,0 +1,881 @@ +using System; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace ReallifeGamemode.Migrations +{ + public partial class Initial : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "BankAccountTransactionLogs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Sender = table.Column(maxLength: 32, nullable: true), + SenderBalance = table.Column(nullable: false), + MoneySent = table.Column(nullable: false), + Receiver = table.Column(maxLength: 32, nullable: true), + ReceiverBalance = table.Column(nullable: false), + NewSenderBalance = table.Column(nullable: false), + NewReceiverBalance = table.Column(nullable: false), + Fee = table.Column(nullable: false), + Origin = table.Column(maxLength: 32, nullable: true), + Timestamp = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_BankAccountTransactionLogs", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Blips", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Sprite = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Name = table.Column(nullable: true), + Scale = table.Column(nullable: false), + Color = table.Column(nullable: false), + Alpha = table.Column(nullable: false), + DrawDistance = table.Column(nullable: false), + ShortRange = table.Column(nullable: false), + Rotation = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Blips", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "BusinessBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Balance = table.Column(nullable: false), + BusinessId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_BusinessBankAccounts", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "ClothCombinations", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Gender = table.Column(nullable: false), + Top = table.Column(nullable: false), + Torso = table.Column(nullable: false), + Undershirt = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_ClothCombinations", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Factions", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(maxLength: 32, nullable: true), + StateOwned = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Factions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "GotoPoints", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(maxLength: 32, nullable: true), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_GotoPoints", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Interiors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(nullable: true), + EnterPosition = table.Column(nullable: true), + ExitPosition = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Interiors", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Markers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Type = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Scale = table.Column(nullable: false), + DirectionX = table.Column(nullable: false), + DirectionY = table.Column(nullable: false), + DirectionZ = table.Column(nullable: false), + RotationX = table.Column(nullable: false), + RotationY = table.Column(nullable: false), + RotationZ = table.Column(nullable: false), + ColorR = table.Column(nullable: false), + ColorG = table.Column(nullable: false), + ColorB = table.Column(nullable: false), + ColorA = table.Column(nullable: false), + Visible = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Markers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Peds", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + HashModel = table.Column(nullable: true), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Heading = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Peds", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Pickups", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + PositionX = table.Column(maxLength: 128, nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + RotationX = table.Column(nullable: false), + RotationY = table.Column(nullable: false), + RotationZ = table.Column(nullable: false), + Vehicle = table.Column(nullable: false), + RespawnTime = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Pickups", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "TextLabels", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Text = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + LOS = table.Column(nullable: false), + Font = table.Column(nullable: false), + DrawDistance = table.Column(nullable: false), + ColorR = table.Column(nullable: false), + ColorG = table.Column(nullable: false), + ColorB = table.Column(nullable: false), + ColorA = table.Column(nullable: false), + Dimension = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_TextLabels", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "WhitelistEntries", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + SocialClubName = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_WhitelistEntries", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "Doors", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Category = table.Column(nullable: true), + Name = table.Column(nullable: true), + Locked = table.Column(nullable: false), + Model = table.Column(nullable: false), + X = table.Column(nullable: false), + Y = table.Column(nullable: false), + Z = table.Column(nullable: false), + Radius = table.Column(nullable: false), + FactionId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Doors", x => x.Id); + table.ForeignKey( + name: "FK_Doors_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "DutyClothes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + Gender = table.Column(nullable: false), + SlotType = table.Column(nullable: false), + SlotId = table.Column(nullable: false), + ClothId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_DutyClothes", x => x.Id); + table.ForeignKey( + name: "FK_DutyClothes_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "FactionBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + FactionId = table.Column(nullable: false), + Bic = table.Column(maxLength: 12, nullable: true), + Iban = table.Column(maxLength: 32, nullable: true), + Balance = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionBankAccounts", x => x.Id); + table.ForeignKey( + name: "FK_FactionBankAccounts_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "FactionRanks", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + RankName = table.Column(nullable: true), + Order = table.Column(nullable: false), + FactionId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_FactionRanks", x => x.Id); + table.ForeignKey( + name: "FK_FactionRanks_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Users", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Name = table.Column(maxLength: 32, nullable: true), + SocialClubName = table.Column(maxLength: 32, nullable: true), + Password = table.Column(maxLength: 64, nullable: true), + LogUserId = table.Column(nullable: false), + RegistrationDate = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Email = table.Column(maxLength: 64, nullable: true), + AdminLevel = table.Column(nullable: false), + Dead = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + CharacterId = table.Column(nullable: true), + BanId = table.Column(nullable: true), + FactionId = table.Column(nullable: true), + FactionLeader = table.Column(nullable: false), + FactionRankId = table.Column(nullable: true), + BusinessId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_Users", x => x.Id); + table.ForeignKey( + name: "FK_Users_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_Users_FactionRanks_FactionRankId", + column: x => x.FactionRankId, + principalTable: "FactionRanks", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "Bans", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Reason = table.Column(nullable: true), + BannedBy = table.Column(nullable: true), + Applied = table.Column(nullable: false), + UntilDateTime = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Bans", x => x.Id); + table.ForeignKey( + name: "FK_Bans_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "CharacterClothes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Duty = table.Column(nullable: false), + SlotType = table.Column(nullable: false), + SlotId = table.Column(nullable: false), + ClothId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_CharacterClothes", x => x.Id); + table.ForeignKey( + name: "FK_CharacterClothes_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "Characters", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Gender = table.Column(nullable: false), + Father = table.Column(nullable: false), + Mother = table.Column(nullable: false), + Similarity = table.Column(nullable: false), + SkinSimilarity = table.Column(nullable: false), + NoseWidth = table.Column(nullable: false), + NoseBottomHeight = table.Column(nullable: false), + NoseTipLength = table.Column(nullable: false), + NoseBridgeDepth = table.Column(nullable: false), + NoseTipHeight = table.Column(nullable: false), + NoseBroken = table.Column(nullable: false), + BrowHeight = table.Column(nullable: false), + BrowDepth = table.Column(nullable: false), + CheekboneHeight = table.Column(nullable: false), + CheekboneWidth = table.Column(nullable: false), + CheekDepth = table.Column(nullable: false), + EyeSize = table.Column(nullable: false), + LipThickness = table.Column(nullable: false), + JawWidth = table.Column(nullable: false), + JawShape = table.Column(nullable: false), + ChinHeight = table.Column(nullable: false), + ChinDepth = table.Column(nullable: false), + ChinWidth = table.Column(nullable: false), + ChinIndent = table.Column(nullable: false), + NeckWidth = table.Column(nullable: false), + Blemishes = table.Column(nullable: false), + BlemishesOpacity = table.Column(nullable: false), + FacialHair = table.Column(nullable: false), + FacialHairOpacity = table.Column(nullable: false), + Eyebrows = table.Column(nullable: false), + EyebrowsOpacity = table.Column(nullable: false), + Ageing = table.Column(nullable: false), + AgeingOpacity = table.Column(nullable: false), + Makeup = table.Column(nullable: false), + MakeupOpacity = table.Column(nullable: false), + Blush = table.Column(nullable: false), + BlushOpacity = table.Column(nullable: false), + Complexion = table.Column(nullable: false), + ComplexionOpacity = table.Column(nullable: false), + SunDamage = table.Column(nullable: false), + SunDamageOpacity = table.Column(nullable: false), + Lipstick = table.Column(nullable: false), + LipstickOpacity = table.Column(nullable: false), + Freckles = table.Column(nullable: false), + FrecklesOpacity = table.Column(nullable: false), + ChestHair = table.Column(nullable: false), + ChestHairOpacity = table.Column(nullable: false), + Hair = table.Column(nullable: false), + HairColor = table.Column(nullable: false), + HairHighlightColor = table.Column(nullable: false), + EyebrowColor = table.Column(nullable: false), + BeardColor = table.Column(nullable: false), + EyeColor = table.Column(nullable: false), + BlushColor = table.Column(nullable: false), + LipstickColor = table.Column(nullable: false), + ChestHairColor = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_Characters", x => x.Id); + table.ForeignKey( + name: "FK_Characters_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "DeathLogs", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + VictimId = table.Column(nullable: false), + KillerId = table.Column(nullable: true), + VictimPositionX = table.Column(nullable: false), + VictimPositionY = table.Column(nullable: false), + VictimPositionZ = table.Column(nullable: false), + VictimHeading = table.Column(nullable: false), + KillerPositionX = table.Column(nullable: false), + KillerPositionY = table.Column(nullable: false), + KillerPositionZ = table.Column(nullable: false), + KillerHeading = table.Column(nullable: false), + CauseOfDeath = table.Column(maxLength: 64, nullable: true), + Timestamp = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + }, + constraints: table => + { + table.PrimaryKey("PK_DeathLogs", x => x.Id); + table.ForeignKey( + name: "FK_DeathLogs_Users_KillerId", + column: x => x.KillerId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_DeathLogs_Users_VictimId", + column: x => x.VictimId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "News", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: true), + Caption = table.Column(nullable: true), + Content = table.Column(nullable: true), + Active = table.Column(nullable: false), + Timestamp = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_News", x => x.Id); + table.ForeignKey( + name: "FK_News_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "ServerVehicles", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Model = table.Column(nullable: false), + PositionX = table.Column(nullable: false), + PositionY = table.Column(nullable: false), + PositionZ = table.Column(nullable: false), + Heading = table.Column(nullable: false), + NumberPlate = table.Column(maxLength: 8, nullable: true), + PrimaryColor = table.Column(nullable: false), + SecondaryColor = table.Column(nullable: false), + Locked = table.Column(nullable: false), + Active = table.Column(nullable: false, defaultValue: true), + Discriminator = table.Column(nullable: false), + FactionId = table.Column(nullable: true), + ShopId = table.Column(nullable: true), + BusinessId = table.Column(nullable: true), + Price = table.Column(nullable: true), + UserId = table.Column(nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_ServerVehicles", x => x.Id); + table.ForeignKey( + name: "FK_ServerVehicles_Factions_FactionId", + column: x => x.FactionId, + principalTable: "Factions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_ServerVehicles_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "UserBankAccounts", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + UserId = table.Column(nullable: false), + Bic = table.Column(maxLength: 12, nullable: true), + Iban = table.Column(maxLength: 32, nullable: true), + Balance = table.Column(nullable: false), + Active = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserBankAccounts", x => x.Id); + table.ForeignKey( + name: "FK_UserBankAccounts_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "UserItems", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ItemId = table.Column(nullable: false), + UserId = table.Column(nullable: false), + Amount = table.Column(nullable: false), + Slot = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_UserItems", x => x.Id); + table.ForeignKey( + name: "FK_UserItems_Users_UserId", + column: x => x.UserId, + principalTable: "Users", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "VehicleMods", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ServerVehicleId = table.Column(nullable: false), + Slot = table.Column(nullable: false), + ModId = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_VehicleMods", x => x.Id); + table.ForeignKey( + name: "FK_VehicleMods_ServerVehicles_ServerVehicleId", + column: x => x.ServerVehicleId, + principalTable: "ServerVehicles", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_Bans_UserId", + table: "Bans", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_BusinessBankAccounts_BusinessId", + table: "BusinessBankAccounts", + column: "BusinessId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_CharacterClothes_UserId", + table: "CharacterClothes", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Characters_UserId", + table: "Characters", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_DeathLogs_KillerId", + table: "DeathLogs", + column: "KillerId"); + + migrationBuilder.CreateIndex( + name: "IX_DeathLogs_VictimId", + table: "DeathLogs", + column: "VictimId"); + + migrationBuilder.CreateIndex( + name: "IX_Doors_FactionId", + table: "Doors", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_DutyClothes_FactionId", + table: "DutyClothes", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_FactionBankAccounts_FactionId", + table: "FactionBankAccounts", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_FactionRanks_FactionId", + table: "FactionRanks", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_News_UserId", + table: "News", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_ServerVehicles_FactionId", + table: "ServerVehicles", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_ServerVehicles_UserId", + table: "ServerVehicles", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserBankAccounts_UserId", + table: "UserBankAccounts", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_UserItems_UserId", + table: "UserItems", + column: "UserId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_BanId", + table: "Users", + column: "BanId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_BusinessId", + table: "Users", + column: "BusinessId", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_Users_CharacterId", + table: "Users", + column: "CharacterId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_FactionId", + table: "Users", + column: "FactionId"); + + migrationBuilder.CreateIndex( + name: "IX_Users_FactionRankId", + table: "Users", + column: "FactionRankId"); + + migrationBuilder.CreateIndex( + name: "IX_VehicleMods_ServerVehicleId_Slot", + table: "VehicleMods", + columns: new[] { "ServerVehicleId", "Slot" }, + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_Users_Bans_BanId", + table: "Users", + column: "BanId", + principalTable: "Bans", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_Users_Characters_CharacterId", + table: "Users", + column: "CharacterId", + principalTable: "Characters", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_Bans_Users_UserId", + table: "Bans"); + + migrationBuilder.DropForeignKey( + name: "FK_Characters_Users_UserId", + table: "Characters"); + + migrationBuilder.DropTable( + name: "BankAccountTransactionLogs"); + + migrationBuilder.DropTable( + name: "Blips"); + + migrationBuilder.DropTable( + name: "BusinessBankAccounts"); + + migrationBuilder.DropTable( + name: "CharacterClothes"); + + migrationBuilder.DropTable( + name: "ClothCombinations"); + + migrationBuilder.DropTable( + name: "DeathLogs"); + + migrationBuilder.DropTable( + name: "Doors"); + + migrationBuilder.DropTable( + name: "DutyClothes"); + + migrationBuilder.DropTable( + name: "FactionBankAccounts"); + + migrationBuilder.DropTable( + name: "GotoPoints"); + + migrationBuilder.DropTable( + name: "Interiors"); + + migrationBuilder.DropTable( + name: "Markers"); + + migrationBuilder.DropTable( + name: "News"); + + migrationBuilder.DropTable( + name: "Peds"); + + migrationBuilder.DropTable( + name: "Pickups"); + + migrationBuilder.DropTable( + name: "TextLabels"); + + migrationBuilder.DropTable( + name: "UserBankAccounts"); + + migrationBuilder.DropTable( + name: "UserItems"); + + migrationBuilder.DropTable( + name: "VehicleMods"); + + migrationBuilder.DropTable( + name: "WhitelistEntries"); + + migrationBuilder.DropTable( + name: "ServerVehicles"); + + migrationBuilder.DropTable( + name: "Users"); + + migrationBuilder.DropTable( + name: "Bans"); + + migrationBuilder.DropTable( + name: "Characters"); + + migrationBuilder.DropTable( + name: "FactionRanks"); + + migrationBuilder.DropTable( + name: "Factions"); + } + } +} diff --git a/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs new file mode 100644 index 00000000..ca4d8b3e --- /dev/null +++ b/ReallifeGamemode.Server/Migrations/DatabaseContextModelSnapshot.cs @@ -0,0 +1,998 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using reallife_gamemode.Server.Models; + +namespace ReallifeGamemode.Migrations +{ + [DbContext(typeof(DatabaseContext))] + partial class DatabaseContextModelSnapshot : ModelSnapshot + { + protected override void BuildModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.2.0-rtm-35687") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Ban", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Applied"); + + b.Property("BannedBy"); + + b.Property("Reason"); + + b.Property("UntilDateTime"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Bans"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.BusinessBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Balance"); + + b.Property("BusinessId"); + + b.HasKey("Id"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.ToTable("BusinessBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Character", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Ageing"); + + b.Property("AgeingOpacity"); + + b.Property("BeardColor"); + + b.Property("Blemishes"); + + b.Property("BlemishesOpacity"); + + b.Property("Blush"); + + b.Property("BlushColor"); + + b.Property("BlushOpacity"); + + b.Property("BrowDepth"); + + b.Property("BrowHeight"); + + b.Property("CheekDepth"); + + b.Property("CheekboneHeight"); + + b.Property("CheekboneWidth"); + + b.Property("ChestHair"); + + b.Property("ChestHairColor"); + + b.Property("ChestHairOpacity"); + + b.Property("ChinDepth"); + + b.Property("ChinHeight"); + + b.Property("ChinIndent"); + + b.Property("ChinWidth"); + + b.Property("Complexion"); + + b.Property("ComplexionOpacity"); + + b.Property("EyeColor"); + + b.Property("EyeSize"); + + b.Property("EyebrowColor"); + + b.Property("Eyebrows"); + + b.Property("EyebrowsOpacity"); + + b.Property("FacialHair"); + + b.Property("FacialHairOpacity"); + + b.Property("Father"); + + b.Property("Freckles"); + + b.Property("FrecklesOpacity"); + + b.Property("Gender"); + + b.Property("Hair"); + + b.Property("HairColor"); + + b.Property("HairHighlightColor"); + + b.Property("JawShape"); + + b.Property("JawWidth"); + + b.Property("LipThickness"); + + b.Property("Lipstick"); + + b.Property("LipstickColor"); + + b.Property("LipstickOpacity"); + + b.Property("Makeup"); + + b.Property("MakeupOpacity"); + + b.Property("Mother"); + + b.Property("NeckWidth"); + + b.Property("NoseBottomHeight"); + + b.Property("NoseBridgeDepth"); + + b.Property("NoseBroken"); + + b.Property("NoseTipHeight"); + + b.Property("NoseTipLength"); + + b.Property("NoseWidth"); + + b.Property("Similarity"); + + b.Property("SkinSimilarity"); + + b.Property("SunDamage"); + + b.Property("SunDamageOpacity"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Characters"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.CharacterCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("Duty"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("CharacterClothes"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ClothCombination", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Gender"); + + b.Property("Top"); + + b.Property("Torso"); + + b.Property("Undershirt"); + + b.HasKey("Id"); + + b.ToTable("ClothCombinations"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Door", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Category"); + + b.Property("FactionId"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("Name"); + + b.Property("Radius"); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("Doors"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.DutyCloth", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ClothId"); + + b.Property("FactionId"); + + b.Property("Gender"); + + b.Property("SlotId"); + + b.Property("SlotType"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("DutyClothes"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Faction", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("StateOwned"); + + b.HasKey("Id"); + + b.ToTable("Factions"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("FactionId"); + + b.Property("Iban") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionRank", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("FactionId"); + + b.Property("Order"); + + b.Property("RankName"); + + b.HasKey("Id"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionRanks"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.GotoPoint", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Description") + .HasMaxLength(32); + + b.Property("X"); + + b.Property("Y"); + + b.Property("Z"); + + b.HasKey("Id"); + + b.ToTable("GotoPoints"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Interior", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("EnterPositionStr") + .HasColumnName("EnterPosition"); + + b.Property("ExitPositionStr") + .HasColumnName("ExitPosition"); + + b.Property("Name"); + + b.HasKey("Id"); + + b.ToTable("Interiors"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.News", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Caption"); + + b.Property("Content"); + + b.Property("Timestamp"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("News"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ServerVehicle", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active") + .ValueGeneratedOnAdd() + .HasDefaultValue(true); + + b.Property("Discriminator") + .IsRequired(); + + b.Property("Heading"); + + b.Property("Locked"); + + b.Property("Model"); + + b.Property("NumberPlate") + .HasMaxLength(8); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("PrimaryColor"); + + b.Property("SecondaryColor"); + + b.HasKey("Id"); + + b.ToTable("ServerVehicles"); + + b.HasDiscriminator("Discriminator").HasValue("ServerVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("AdminLevel"); + + b.Property("BanId"); + + b.Property("BusinessId"); + + b.Property("CharacterId"); + + b.Property("Dead"); + + b.Property("Email") + .HasMaxLength(64); + + b.Property("FactionId"); + + b.Property("FactionLeader"); + + b.Property("FactionRankId"); + + b.Property("LogUserId"); + + b.Property("Name") + .HasMaxLength(32); + + b.Property("Password") + .HasMaxLength(64); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RegistrationDate") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName") + .HasMaxLength(32); + + b.HasKey("Id"); + + b.HasIndex("BanId"); + + b.HasIndex("BusinessId") + .IsUnique(); + + b.HasIndex("CharacterId"); + + b.HasIndex("FactionId"); + + b.HasIndex("FactionRankId"); + + b.ToTable("Users"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserBankAccount", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Balance"); + + b.Property("Bic") + .HasMaxLength(12); + + b.Property("Iban") + .HasMaxLength(32); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserBankAccounts"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Amount"); + + b.Property("ItemId"); + + b.Property("Slot"); + + b.Property("UserId"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserItems"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.VehicleMod", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("ModId"); + + b.Property("ServerVehicleId"); + + b.Property("Slot"); + + b.HasKey("Id"); + + b.HasIndex("ServerVehicleId", "Slot") + .IsUnique(); + + b.ToTable("VehicleMods"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Whitelist", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("SocialClubName"); + + b.HasKey("Id"); + + b.ToTable("WhitelistEntries"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.BankAccountTransactionHistory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Fee"); + + b.Property("MoneySent"); + + b.Property("NewReceiverBalance"); + + b.Property("NewSenderBalance"); + + b.Property("Origin") + .HasMaxLength(32); + + b.Property("Receiver") + .HasMaxLength(32); + + b.Property("ReceiverBalance"); + + b.Property("Sender") + .HasMaxLength(32); + + b.Property("SenderBalance"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.HasKey("Id"); + + b.ToTable("BankAccountTransactionLogs"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.Death", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("CauseOfDeath") + .HasMaxLength(64); + + b.Property("KillerHeading"); + + b.Property("KillerId"); + + b.Property("KillerPositionX"); + + b.Property("KillerPositionY"); + + b.Property("KillerPositionZ"); + + b.Property("Timestamp") + .ValueGeneratedOnAdd(); + + b.Property("VictimHeading"); + + b.Property("VictimId"); + + b.Property("VictimPositionX"); + + b.Property("VictimPositionY"); + + b.Property("VictimPositionZ"); + + b.HasKey("Id"); + + b.HasIndex("KillerId"); + + b.HasIndex("VictimId"); + + b.ToTable("DeathLogs"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedBlip", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Alpha"); + + b.Property("Color"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Name"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Rotation"); + + b.Property("Scale"); + + b.Property("ShortRange"); + + b.Property("Sprite"); + + b.HasKey("Id"); + + b.ToTable("Blips"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedMarker", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DirectionX"); + + b.Property("DirectionY"); + + b.Property("DirectionZ"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Scale"); + + b.Property("Type"); + + b.Property("Visible"); + + b.HasKey("Id"); + + b.ToTable("Markers"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedPed", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("HashModel"); + + b.Property("Heading"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.HasKey("Id"); + + b.ToTable("Peds"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedPickup", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("Dimension"); + + b.Property("PositionX") + .HasMaxLength(128); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("RespawnTime"); + + b.Property("RotationX"); + + b.Property("RotationY"); + + b.Property("RotationZ"); + + b.Property("Vehicle"); + + b.HasKey("Id"); + + b.ToTable("Pickups"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedTextLabel", b => + { + b.Property("Id") + .ValueGeneratedOnAdd(); + + b.Property("Active"); + + b.Property("ColorA"); + + b.Property("ColorB"); + + b.Property("ColorG"); + + b.Property("ColorR"); + + b.Property("Dimension"); + + b.Property("DrawDistance"); + + b.Property("Font"); + + b.Property("LOS"); + + b.Property("PositionX"); + + b.Property("PositionY"); + + b.Property("PositionZ"); + + b.Property("Text") + .IsRequired(); + + b.HasKey("Id"); + + b.ToTable("TextLabels"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("FactionId"); + + b.HasIndex("FactionId"); + + b.ToTable("FactionVehicles"); + + b.HasDiscriminator().HasValue("FactionVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.ShopVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("BusinessId"); + + b.Property("Price"); + + b.Property("ShopId"); + + b.ToTable("ShopVehicles"); + + b.HasDiscriminator().HasValue("ShopVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.Property("UserId"); + + b.HasIndex("UserId"); + + b.ToTable("UserVehicles"); + + b.HasDiscriminator().HasValue("UserVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Saves.SavedVehicle", b => + { + b.HasBaseType("reallife_gamemode.Server.Entities.ServerVehicle"); + + b.HasDiscriminator().HasValue("SavedVehicle"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Ban", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Character", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.CharacterCloth", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.Door", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.DutyCloth", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionBankAccount", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionRank", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.News", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.User", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Ban", "Ban") + .WithMany() + .HasForeignKey("BanId"); + + b.HasOne("reallife_gamemode.Server.Entities.Character", "Character") + .WithMany() + .HasForeignKey("CharacterId"); + + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + + b.HasOne("reallife_gamemode.Server.Entities.FactionRank", "FactionRank") + .WithMany() + .HasForeignKey("FactionRankId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserBankAccount", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserItem", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.VehicleMod", b => + { + b.HasOne("reallife_gamemode.Server.Entities.ServerVehicle", "Vehicle") + .WithMany() + .HasForeignKey("ServerVehicleId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Logs.Death", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "Killer") + .WithMany() + .HasForeignKey("KillerId"); + + b.HasOne("reallife_gamemode.Server.Entities.User", "Victim") + .WithMany() + .HasForeignKey("VictimId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.FactionVehicle", b => + { + b.HasOne("reallife_gamemode.Server.Entities.Faction", "Faction") + .WithMany() + .HasForeignKey("FactionId"); + }); + + modelBuilder.Entity("reallife_gamemode.Server.Entities.UserVehicle", b => + { + b.HasOne("reallife_gamemode.Server.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +}