using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; namespace ReallifeGamemode.Database.Migrations { public partial class Initial : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "ATMs", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Balance = table.Column(nullable: false), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), Faulty = table.Column(nullable: false), Active = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ATMs", x => x.Id); }); 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: "BusinessData", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), BusinessId = table.Column(nullable: false), Price = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_BusinessData", x => x.Id); }); migrationBuilder.CreateTable( name: "BusRoutes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_BusRoutes", 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), WeaponDealTime = 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: "Groups", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Name = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Groups", 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: "Locations", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(nullable: true), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), Heading = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Locations", 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: "ShopClothes", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ClotheId = table.Column(nullable: false), Gender = table.Column(nullable: false), TypeId = table.Column(nullable: true), ComponentId = table.Column(nullable: false), Category = table.Column(nullable: false), Price = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_ShopClothes", 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: "TuningGarages", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_TuningGarages", x => x.Id); }); migrationBuilder.CreateTable( name: "Turfs", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FactionId = table.Column(nullable: true), Owner = table.Column(nullable: true), Name = table.Column(nullable: true), X = table.Column(nullable: false), Y = table.Column(nullable: false), Rotation = table.Column(nullable: false), Range = table.Column(nullable: false), Color = table.Column(nullable: false), Vector = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Turfs", 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: "BusRoutesPoints", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Description = table.Column(nullable: true), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), BusRouteId = table.Column(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.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: "FactionWeapons", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FactionId = table.Column(nullable: true), WeaponModel = table.Column(nullable: true), SlotID = table.Column(nullable: false), Rank = table.Column(nullable: false), Ammount = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_FactionWeapons", x => x.Id); table.ForeignKey( name: "FK_FactionWeapons_Factions_FactionId", column: x => x.FactionId, principalTable: "Factions", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "GroupBankAccounts", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), GroupId = table.Column(nullable: true), Balance = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_GroupBankAccounts", x => x.Id); table.ForeignKey( name: "FK_GroupBankAccounts_Groups_GroupId", column: x => x.GroupId, principalTable: "Groups", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); 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), Handmoney = 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), BusinessId = table.Column(nullable: true), FactionId = table.Column(nullable: true), FactionLeader = table.Column(nullable: false), FactionRankId = table.Column(nullable: true), GroupId = table.Column(nullable: true), GroupRank = table.Column(nullable: false), HouseId = table.Column(nullable: true), JobId = table.Column(nullable: true), Wanteds = table.Column(nullable: false), Wage = table.Column(nullable: false), JailTime = table.Column(nullable: false), PaydayTimer = table.Column(nullable: false), DriverLicenseVehicle = table.Column(nullable: false), FlyingLicensePlane = table.Column(nullable: false), DriverLicenseBike = table.Column(nullable: false) }, 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); table.ForeignKey( name: "FK_Users_Groups_GroupId", column: x => x.GroupId, principalTable: "Groups", 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), Texture = 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: "Houses", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), Type = table.Column(nullable: true), Price = table.Column(nullable: false), X = table.Column(nullable: false), Y = table.Column(nullable: false), Z = table.Column(nullable: false), RentalFee = table.Column(nullable: false), CanRentIn = table.Column(nullable: false), OwnerId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Houses", x => x.Id); table.ForeignKey( name: "FK_Houses_Users_OwnerId", column: x => x.OwnerId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); 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), DistanceDriven = table.Column(nullable: false), TankAmount = table.Column(nullable: false), Livery = table.Column(nullable: false), Discriminator = table.Column(nullable: false), FactionId = table.Column(nullable: true), GroupId = table.Column(nullable: true), JobId = table.Column(nullable: true), SchoolId = 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_Groups_GroupId", column: x => x.GroupId, principalTable: "Groups", 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: "HouseRentals", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), HouseId = table.Column(nullable: true), UserId = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_HouseRentals", x => x.Id); table.ForeignKey( name: "FK_HouseRentals_Houses_HouseId", column: x => x.HouseId, principalTable: "Houses", principalColumn: "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( name: "FK_HouseRentals_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( name: "VehicleItems", columns: table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), ItemId = table.Column(nullable: false), VehicleId = table.Column(nullable: false), Amount = table.Column(nullable: false), Slot = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_VehicleItems", x => x.Id); table.ForeignKey( name: "FK_VehicleItems_ServerVehicles_VehicleId", column: x => x.VehicleId, principalTable: "ServerVehicles", 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_BusRoutesPoints_BusRouteId", table: "BusRoutesPoints", column: "BusRouteId"); 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_FactionWeapons_FactionId", table: "FactionWeapons", column: "FactionId"); migrationBuilder.CreateIndex( name: "IX_GroupBankAccounts_GroupId", table: "GroupBankAccounts", column: "GroupId"); migrationBuilder.CreateIndex( name: "IX_HouseRentals_HouseId", table: "HouseRentals", column: "HouseId"); migrationBuilder.CreateIndex( name: "IX_HouseRentals_UserId", table: "HouseRentals", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_Houses_OwnerId", table: "Houses", column: "OwnerId"); 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_GroupId", table: "ServerVehicles", column: "GroupId"); 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_Users_GroupId", table: "Users", column: "GroupId"); migrationBuilder.CreateIndex( name: "IX_Users_HouseId", table: "Users", column: "HouseId"); migrationBuilder.CreateIndex( name: "IX_VehicleItems_VehicleId", table: "VehicleItems", column: "VehicleId"); migrationBuilder.CreateIndex( name: "IX_VehicleMods_ServerVehicleId_Slot", table: "VehicleMods", columns: new[] { "ServerVehicleId", "Slot" }, unique: true); migrationBuilder.AddForeignKey( name: "FK_Users_Houses_HouseId", table: "Users", column: "HouseId", principalTable: "Houses", principalColumn: "Id", onDelete: ReferentialAction.Restrict); 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.DropForeignKey( name: "FK_Houses_Users_OwnerId", table: "Houses"); migrationBuilder.DropTable( name: "ATMs"); migrationBuilder.DropTable( name: "BankAccountTransactionLogs"); migrationBuilder.DropTable( name: "Blips"); migrationBuilder.DropTable( name: "BusinessBankAccounts"); migrationBuilder.DropTable( name: "BusinessData"); migrationBuilder.DropTable( name: "BusRoutesPoints"); 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: "FactionWeapons"); migrationBuilder.DropTable( name: "GotoPoints"); migrationBuilder.DropTable( name: "GroupBankAccounts"); migrationBuilder.DropTable( name: "HouseRentals"); migrationBuilder.DropTable( name: "Interiors"); migrationBuilder.DropTable( name: "Locations"); migrationBuilder.DropTable( name: "Markers"); migrationBuilder.DropTable( name: "News"); migrationBuilder.DropTable( name: "Peds"); migrationBuilder.DropTable( name: "Pickups"); migrationBuilder.DropTable( name: "ShopClothes"); migrationBuilder.DropTable( name: "TextLabels"); migrationBuilder.DropTable( name: "TuningGarages"); migrationBuilder.DropTable( name: "Turfs"); migrationBuilder.DropTable( name: "UserBankAccounts"); migrationBuilder.DropTable( name: "UserItems"); migrationBuilder.DropTable( name: "VehicleItems"); migrationBuilder.DropTable( name: "VehicleMods"); migrationBuilder.DropTable( name: "WhitelistEntries"); migrationBuilder.DropTable( name: "BusRoutes"); migrationBuilder.DropTable( name: "ServerVehicles"); migrationBuilder.DropTable( name: "Users"); migrationBuilder.DropTable( name: "Bans"); migrationBuilder.DropTable( name: "Characters"); migrationBuilder.DropTable( name: "FactionRanks"); migrationBuilder.DropTable( name: "Groups"); migrationBuilder.DropTable( name: "Houses"); migrationBuilder.DropTable( name: "Factions"); } } }