using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace RadicadeServer.Migrations { public partial class Inital : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Avatars", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), Avatar = table.Column(type: "nvarchar(max)", nullable: false), Outfits = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Avatars", x => x.AccountId); }); migrationBuilder.CreateTable( name: "CachedLogins", columns: table => new { loginId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), accountId = table.Column(type: "bigint", nullable: false), platform = table.Column(type: "int", nullable: false), platformId = table.Column(type: "nvarchar(max)", nullable: false), lastLoginTime = table.Column(type: "datetime2", nullable: false), requirePassword = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CachedLogins", x => x.loginId); }); migrationBuilder.CreateTable( name: "Chats", columns: table => new { chatThreadId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), chatThreadName = table.Column(type: "nvarchar(max)", nullable: false), lastReadMessageId = table.Column(type: "bigint", nullable: false), messages = table.Column(type: "nvarchar(max)", nullable: false), playerIds = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Chats", x => x.chatThreadId); }); migrationBuilder.CreateTable( name: "Config", columns: table => new { FUCKYOUMICROSOFT = table.Column(type: "nvarchar(450)", nullable: false), ShareBaseUrl = table.Column(type: "nvarchar(max)", nullable: false), CdnBaseUri = table.Column(type: "nvarchar(max)", nullable: false), LevelProgressionMaps = table.Column(type: "nvarchar(max)", nullable: false), ServerMaintenance = table.Column(type: "nvarchar(max)", nullable: false), DailyObjectives = table.Column(type: "nvarchar(max)", nullable: false), AutoMicMutingConfig = table.Column(type: "nvarchar(max)", nullable: false), StorefrontConfig = table.Column(type: "nvarchar(max)", nullable: false), RoomKeyConfig = table.Column(type: "nvarchar(max)", nullable: false), RoomCurrencyConfig = table.Column(type: "nvarchar(max)", nullable: false), GiftDropStoreItems = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Config", x => x.FUCKYOUMICROSOFT); }); migrationBuilder.CreateTable( name: "Currency", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), RecTokens = table.Column(type: "bigint", nullable: false), LaserTagTickets = table.Column(type: "bigint", nullable: false), Gold = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Currency", x => x.AccountId); }); migrationBuilder.CreateTable( name: "CustomContent", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: false), Files = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_CustomContent", x => x.Id); }); migrationBuilder.CreateTable( name: "GameConfig", columns: table => new { Key = table.Column(type: "nvarchar(450)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_GameConfig", x => x.Key); }); migrationBuilder.CreateTable( name: "Gifts", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), Data = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Gifts", x => x.AccountId); }); migrationBuilder.CreateTable( name: "ImageInteractions", columns: table => new { InteractionId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SavedImageId = table.Column(type: "bigint", nullable: false), IsCheered = table.Column(type: "bit", nullable: false), PlayerId = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ImageInteractions", x => x.InteractionId); }); migrationBuilder.CreateTable( name: "Images", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Name = table.Column(type: "nvarchar(max)", nullable: false), OwnerId = table.Column(type: "bigint", nullable: false), ImageType = table.Column(type: "int", nullable: false), Accessibility = table.Column(type: "int", nullable: false), RoomId = table.Column(type: "bigint", nullable: true), EventId = table.Column(type: "bigint", nullable: true), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Images", x => x.Id); }); migrationBuilder.CreateTable( name: "Inventions", columns: table => new { InventionId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ReplicationId = table.Column(type: "nvarchar(max)", nullable: false), CreatorPlayerId = table.Column(type: "int", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: false), ImageName = table.Column(type: "nvarchar(max)", nullable: false), CurrentVersionNumber = table.Column(type: "int", nullable: false), ModifiedAt = table.Column(type: "datetime2", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), NumPlayersHaveUsedInRoom = table.Column(type: "int", nullable: false), NumDownloads = table.Column(type: "int", nullable: false), CheerCount = table.Column(type: "int", nullable: false), CreatorPermission = table.Column(type: "int", nullable: false), GeneralPermission = table.Column(type: "int", nullable: false), IsAGInvention = table.Column(type: "bit", nullable: false), IsCertifiedInvention = table.Column(type: "bit", nullable: false), IsPublished = table.Column(type: "bit", nullable: false), AllowTrial = table.Column(type: "bit", nullable: false), HideFromPlayer = table.Column(type: "bit", nullable: false), Price = table.Column(type: "int", nullable: true), BlobName = table.Column(type: "nvarchar(max)", nullable: false), InstantiationCost = table.Column(type: "int", nullable: false), LightsCost = table.Column(type: "int", nullable: false), RoomOrigin = table.Column(type: "bigint", nullable: false), Tags = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Inventions", x => x.InventionId); }); migrationBuilder.CreateTable( name: "Messages", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), FromPlayerId = table.Column(type: "bigint", nullable: false), ToPlayerId = table.Column(type: "bigint", nullable: false), SentTime = table.Column(type: "datetime2", nullable: false), Type = table.Column(type: "int", nullable: false), Data = table.Column(type: "nvarchar(max)", nullable: false), Details = table.Column(type: "nvarchar(max)", nullable: false), RoomId = table.Column(type: "bigint", nullable: true), PlayerEventId = table.Column(type: "bigint", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Messages", x => x.Id); }); migrationBuilder.CreateTable( name: "Moderation", columns: table => new { Id = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ExpireDuration = table.Column(type: "datetime2", nullable: false), Message = table.Column(type: "nvarchar(max)", nullable: false), Category = table.Column(type: "int", nullable: false), IsBan = table.Column(type: "bit", nullable: false), PlayerId = table.Column(type: "bigint", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Moderation", x => x.Id); }); migrationBuilder.CreateTable( name: "Players", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), Email = table.Column(type: "nvarchar(max)", nullable: false), Phone = table.Column(type: "nvarchar(max)", nullable: false), AppVersion = table.Column(type: "nvarchar(max)", nullable: false), Parent = table.Column(type: "bigint", nullable: true), NameChanges = table.Column(type: "int", nullable: false), JuniorState = table.Column(type: "int", nullable: false), Hashword = table.Column(type: "nvarchar(max)", nullable: false), Birthday = table.Column(type: "datetime2", nullable: true), Visibility = table.Column(type: "int", nullable: false), DeviceClass = table.Column(type: "int", nullable: false), Developer = table.Column(type: "bit", nullable: false), DeviceId = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Players", x => x.AccountId); }); migrationBuilder.CreateTable( name: "PlayerSettings", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), Settings = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_PlayerSettings", x => x.AccountId); }); migrationBuilder.CreateTable( name: "Playlists", columns: table => new { PlaylistId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Keywords = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Playlists", x => x.PlaylistId); }); migrationBuilder.CreateTable( name: "Presences", columns: table => new { playerId = table.Column(type: "bigint", nullable: false), isOnline = table.Column(type: "bit", nullable: false), deviceClass = table.Column(type: "int", nullable: false), statusVisibility = table.Column(type: "int", nullable: false), vRMovementMode = table.Column(type: "int", nullable: false), LoginLock = table.Column(type: "nvarchar(max)", nullable: true), roomInstance = table.Column(type: "bigint", nullable: true), errorCode = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Presences", x => x.playerId); }); migrationBuilder.CreateTable( name: "Profiles", columns: table => new { accountId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), profileImage = table.Column(type: "nvarchar(max)", nullable: false), isJunior = table.Column(type: "bit", nullable: false), platforms = table.Column(type: "int", nullable: false), username = table.Column(type: "nvarchar(max)", nullable: false), displayName = table.Column(type: "nvarchar(max)", nullable: false), bio = table.Column(type: "nvarchar(max)", nullable: true), createdAt = table.Column(type: "datetime2", nullable: false), developer = table.Column(type: "bit", nullable: false), moderator = table.Column(type: "bit", nullable: false), screenshare = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Profiles", x => x.accountId); }); migrationBuilder.CreateTable( name: "Progression", columns: table => new { PlayerId = table.Column(type: "bigint", nullable: false), XP = table.Column(type: "int", nullable: false), Level = table.Column(type: "int", nullable: false), ObjectiveProgress = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Progression", x => x.PlayerId); }); migrationBuilder.CreateTable( name: "Relationships", columns: table => new { RelationshipId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), AccountId = table.Column(type: "bigint", nullable: false), PlayerId = table.Column(type: "bigint", nullable: false), RelationshipType = table.Column(type: "int", nullable: false), Muted = table.Column(type: "int", nullable: false), Ignored = table.Column(type: "int", nullable: false), Favorited = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Relationships", x => x.RelationshipId); }); migrationBuilder.CreateTable( name: "Reputations", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), Noteriety = table.Column(type: "float", nullable: false), CheerGeneral = table.Column(type: "int", nullable: false), CheerHelpful = table.Column(type: "int", nullable: false), CheerCreative = table.Column(type: "int", nullable: false), CheerGreatHost = table.Column(type: "int", nullable: false), CheerSportsman = table.Column(type: "int", nullable: false), CheerCredit = table.Column(type: "int", nullable: false), SelectedCheer = table.Column(type: "int", nullable: false), IsCheerful = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Reputations", x => x.AccountId); }); migrationBuilder.CreateTable( name: "RoomInstances", columns: table => new { roomInstanceId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), roomId = table.Column(type: "bigint", nullable: false), subRoomId = table.Column(type: "bigint", nullable: false), roomInstanceType = table.Column(type: "int", nullable: false), location = table.Column(type: "nvarchar(max)", nullable: true), dataBlob = table.Column(type: "nvarchar(max)", nullable: false), eventId = table.Column(type: "bigint", nullable: true), clubId = table.Column(type: "bigint", nullable: true), roomCode = table.Column(type: "nvarchar(max)", nullable: true), photonRegionId = table.Column(type: "nvarchar(max)", nullable: false), photonRoomId = table.Column(type: "nvarchar(max)", nullable: false), name = table.Column(type: "nvarchar(max)", nullable: false), maxCapacity = table.Column(type: "int", nullable: false), isFull = table.Column(type: "bit", nullable: false), isPrivate = table.Column(type: "bit", nullable: false), isInProgress = table.Column(type: "bit", nullable: false), EncryptVoiceChat = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RoomInstances", x => x.roomInstanceId); }); migrationBuilder.CreateTable( name: "RoomInteractions", columns: table => new { InteractionId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), PlayerId = table.Column(type: "bigint", nullable: false), RoomId = table.Column(type: "bigint", nullable: false), Cheered = table.Column(type: "bit", nullable: false), Favorited = table.Column(type: "bit", nullable: false), VisitCount = table.Column(type: "int", nullable: false), Visited = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RoomInteractions", x => x.InteractionId); }); migrationBuilder.CreateTable( name: "RoomKeys", columns: table => new { RoomKeyId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), ReplicationId = table.Column(type: "nvarchar(max)", nullable: false), RoomId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: false), Price = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RoomKeys", x => x.RoomKeyId); }); migrationBuilder.CreateTable( name: "RoomRoles", columns: table => new { RoleId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), RoomId = table.Column(type: "bigint", nullable: false), AccountId = table.Column(type: "bigint", nullable: false), Role = table.Column(type: "int", nullable: false), InvitedRole = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RoomRoles", x => x.RoleId); }); migrationBuilder.CreateTable( name: "Rooms", columns: table => new { RoomId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Tags = table.Column(type: "nvarchar(max)", nullable: false), IsDorm = table.Column(type: "bit", nullable: false), MaxPlayers = table.Column(type: "int", nullable: false), MaxPlayerCalculationMode = table.Column(type: "int", nullable: false), CloningAllowed = table.Column(type: "bit", nullable: false), DisableMicAutoMute = table.Column(type: "bit", nullable: false), DisableRoomComments = table.Column(type: "bit", nullable: false), EncryptVoiceChat = table.Column(type: "bit", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), Description = table.Column(type: "nvarchar(max)", nullable: true), ImageName = table.Column(type: "nvarchar(max)", nullable: false), WarningMask = table.Column(type: "int", nullable: false), CustomWarning = table.Column(type: "nvarchar(max)", nullable: true), CreatorAccountId = table.Column(type: "bigint", nullable: false), State = table.Column(type: "int", nullable: false), Accessibility = table.Column(type: "int", nullable: false), SupportsLevelVoting = table.Column(type: "bit", nullable: false), IsRRO = table.Column(type: "bit", nullable: false), SupportsScreens = table.Column(type: "bit", nullable: false), SupportsWalkVR = table.Column(type: "bit", nullable: false), SupportsTeleportVR = table.Column(type: "bit", nullable: false), SupportsVRLow = table.Column(type: "bit", nullable: false), SupportsQuest2 = table.Column(type: "bit", nullable: false), SupportsMobile = table.Column(type: "bit", nullable: false), SupportsJuniors = table.Column(type: "bit", nullable: false), MinLevel = table.Column(type: "int", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false), loadScreen = table.Column(type: "nvarchar(max)", nullable: false), Version = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Rooms", x => x.RoomId); }); migrationBuilder.CreateTable( name: "RoomStats", columns: table => new { RoomId = table.Column(type: "bigint", nullable: false), CheerCount = table.Column(type: "int", nullable: false), FavoriteCount = table.Column(type: "int", nullable: false), VisitorCount = table.Column(type: "int", nullable: false), VisitCount = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_RoomStats", x => x.RoomId); }); migrationBuilder.CreateTable( name: "ServerConfig", columns: table => new { Key = table.Column(type: "nvarchar(450)", nullable: false), Value = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_ServerConfig", x => x.Key); }); migrationBuilder.CreateTable( name: "SubRoomHistory", columns: table => new { HistoryId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), SubRoomId = table.Column(type: "bigint", nullable: false), RoomId = table.Column(type: "bigint", nullable: false), SavedByAccountId = table.Column(type: "bigint", nullable: false), DataBlob = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SubRoomHistory", x => x.HistoryId); }); migrationBuilder.CreateTable( name: "SubRooms", columns: table => new { SubRoomId = table.Column(type: "bigint", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), RoomId = table.Column(type: "bigint", nullable: false), SavedByAccountId = table.Column(type: "bigint", nullable: false), Name = table.Column(type: "nvarchar(max)", nullable: false), DataBlob = table.Column(type: "nvarchar(max)", nullable: false), IsSandbox = table.Column(type: "bit", nullable: false), MaxPlayers = table.Column(type: "int", nullable: false), Accessibility = table.Column(type: "int", nullable: false), UnitySceneId = table.Column(type: "nvarchar(max)", nullable: false), CreatedAt = table.Column(type: "datetime2", nullable: false) }, constraints: table => { table.PrimaryKey("PK_SubRooms", x => x.SubRoomId); }); migrationBuilder.CreateTable( name: "Unlocks", columns: table => new { AccountId = table.Column(type: "bigint", nullable: false), AvatarItems = table.Column(type: "nvarchar(max)", nullable: false), Consumables = table.Column(type: "nvarchar(max)", nullable: false), Equipment = table.Column(type: "nvarchar(max)", nullable: false), Inventions = table.Column(type: "nvarchar(max)", nullable: false), RoomKeys = table.Column(type: "nvarchar(max)", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Unlocks", x => x.AccountId); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Avatars"); migrationBuilder.DropTable( name: "CachedLogins"); migrationBuilder.DropTable( name: "Chats"); migrationBuilder.DropTable( name: "Config"); migrationBuilder.DropTable( name: "Currency"); migrationBuilder.DropTable( name: "CustomContent"); migrationBuilder.DropTable( name: "GameConfig"); migrationBuilder.DropTable( name: "Gifts"); migrationBuilder.DropTable( name: "ImageInteractions"); migrationBuilder.DropTable( name: "Images"); migrationBuilder.DropTable( name: "Inventions"); migrationBuilder.DropTable( name: "Messages"); migrationBuilder.DropTable( name: "Moderation"); migrationBuilder.DropTable( name: "Players"); migrationBuilder.DropTable( name: "PlayerSettings"); migrationBuilder.DropTable( name: "Playlists"); migrationBuilder.DropTable( name: "Presences"); migrationBuilder.DropTable( name: "Profiles"); migrationBuilder.DropTable( name: "Progression"); migrationBuilder.DropTable( name: "Relationships"); migrationBuilder.DropTable( name: "Reputations"); migrationBuilder.DropTable( name: "RoomInstances"); migrationBuilder.DropTable( name: "RoomInteractions"); migrationBuilder.DropTable( name: "RoomKeys"); migrationBuilder.DropTable( name: "RoomRoles"); migrationBuilder.DropTable( name: "Rooms"); migrationBuilder.DropTable( name: "RoomStats"); migrationBuilder.DropTable( name: "ServerConfig"); migrationBuilder.DropTable( name: "SubRoomHistory"); migrationBuilder.DropTable( name: "SubRooms"); migrationBuilder.DropTable( name: "Unlocks"); } } }