using System; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace LANCommander.Server.Data.MySQL.Migrations { /// public partial class InitialMigration : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterDatabase() .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Users", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PasswordHash = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), SecurityStamp = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Email = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedEmail = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), EmailConfirmed = table.Column(type: "tinyint(1)", nullable: false), NormalizedUserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PhoneNumber = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PhoneNumberConfirmed = table.Column(type: "tinyint(1)", nullable: false), TwoFactorEnabled = table.Column(type: "tinyint(1)", nullable: false), LockoutEnd = table.Column(type: "datetime(6)", nullable: true), LockoutEnabled = table.Column(type: "tinyint(1)", nullable: false), AccessFailedCount = table.Column(type: "int", nullable: false), RefreshToken = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), RefreshTokenExpiration = table.Column(type: "datetime(6)", nullable: false), Approved = table.Column(type: "tinyint(1)", nullable: false), ApprovedOn = table.Column(type: "datetime(6)", nullable: true), Alias = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Users", x => x.Id); table.ForeignKey( name: "FK_Users_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Users_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Categories", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ParentId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Categories", x => x.Id); table.ForeignKey( name: "FK_Categories_Categories_ParentId", column: x => x.ParentId, principalTable: "Categories", principalColumn: "Id"); table.ForeignKey( name: "FK_Categories_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Categories_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ChatThreads", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ChatThreads", x => x.Id); table.ForeignKey( name: "FK_ChatThreads_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_ChatThreads_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Collections", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Collections", x => x.Id); table.ForeignKey( name: "FK_Collections_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Collections_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Companies", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Companies", x => x.Id); table.ForeignKey( name: "FK_Companies_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Companies_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Engines", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Engines", x => x.Id); table.ForeignKey( name: "FK_Engines_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_Engines_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Genres", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Genres", x => x.Id); table.ForeignKey( name: "FK_Genres_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Genres_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Libraries", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Libraries", x => x.Id); table.ForeignKey( name: "FK_Libraries_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Libraries_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Libraries_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Platforms", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Platforms", x => x.Id); table.ForeignKey( name: "FK_Platforms_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Platforms_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Redistributables", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Notes = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), OptionSchema = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Redistributables", x => x.Id); table.ForeignKey( name: "FK_Redistributables_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Redistributables_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Roles", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), NormalizedName = table.Column(type: "varchar(256)", maxLength: 256, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ConcurrencyStamp = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Roles", x => x.Id); table.ForeignKey( name: "FK_Roles_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Roles_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "StorageLocations", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Default = table.Column(type: "tinyint(1)", nullable: false), Path = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "int", nullable: false), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_StorageLocations", x => x.Id); table.ForeignKey( name: "FK_StorageLocations_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_StorageLocations_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Tags", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_Tags", x => x.Id); table.ForeignKey( name: "FK_Tags_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Tags_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Tools", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Notes = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Tools", x => x.Id); table.ForeignKey( name: "FK_Tools_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Tools_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UserClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ClaimType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_UserClaims", x => x.Id); table.ForeignKey( name: "FK_UserClaims_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UserCustomField", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_UserCustomField", x => x.Id); table.ForeignKey( name: "FK_UserCustomField_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_UserCustomField_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_UserCustomField_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UserLogins", columns: table => new { LoginProvider = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProviderKey = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ProviderDisplayName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_UserLogins", x => new { x.LoginProvider, x.ProviderKey }); table.ForeignKey( name: "FK_UserLogins_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UserTokens", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LoginProvider = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Name = table.Column(type: "varchar(255)", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_UserTokens", x => new { x.UserId, x.LoginProvider, x.Name }); table.ForeignKey( name: "FK_UserTokens_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ChatMessages", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ThreadId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Content = table.Column(type: "varchar(2000)", maxLength: 2000, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ChatMessages", x => x.Id); table.ForeignKey( name: "FK_ChatMessages_ChatThreads_ThreadId", column: x => x.ThreadId, principalTable: "ChatThreads", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ChatMessages_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_ChatMessages_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ChatThreadUser", columns: table => new { ChatThreadsId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ParticipantsId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ChatThreadUser", x => new { x.ChatThreadsId, x.ParticipantsId }); table.ForeignKey( name: "FK_ChatThreadUser_ChatThreads_ChatThreadsId", column: x => x.ChatThreadsId, principalTable: "ChatThreads", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ChatThreadUser_Users_ParticipantsId", column: x => x.ParticipantsId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Games", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Title = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SortTitle = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), DirectoryName = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Notes = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ReleasedOn = table.Column(type: "datetime(6)", nullable: true), KeyAllocationMethod = table.Column(type: "int", nullable: false), Type = table.Column(type: "int", nullable: false), BaseGameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Singleplayer = table.Column(type: "tinyint(1)", nullable: false), EngineId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ValidKeyRegex = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Games", x => x.Id); table.ForeignKey( name: "FK_Games_Engines_EngineId", column: x => x.EngineId, principalTable: "Engines", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Games_Games_BaseGameId", column: x => x.BaseGameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Games_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Games_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RoleClaims", columns: table => new { Id = table.Column(type: "int", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ClaimType = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClaimValue = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_RoleClaims", x => x.Id); table.ForeignKey( name: "FK_RoleClaims_Roles_RoleId", column: x => x.RoleId, principalTable: "Roles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "RoleCollection", columns: table => new { CollectionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_RoleCollection", x => new { x.CollectionId, x.RoleId }); table.ForeignKey( name: "FK_RoleCollection_Collections_CollectionId", column: x => x.CollectionId, principalTable: "Collections", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_RoleCollection_Roles_RoleId", column: x => x.RoleId, principalTable: "Roles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "UserRoles", columns: table => new { UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RoleId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId }); table.ForeignKey( name: "FK_UserRoles_Roles_RoleId", column: x => x.RoleId, principalTable: "Roles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_UserRoles_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Pages", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Title = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Slug = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Route = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Contents = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SortOrder = table.Column(type: "int", nullable: false), ParentId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ToolId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Pages", x => x.Id); table.ForeignKey( name: "FK_Pages_Pages_ParentId", column: x => x.ParentId, principalTable: "Pages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Pages_Tools_ToolId", column: x => x.ToolId, principalTable: "Tools", principalColumn: "Id"); table.ForeignKey( name: "FK_Pages_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Pages_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ChatThreadReadStatuses", columns: table => new { ThreadId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LastReadMessageId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ChatThreadReadStatuses", x => new { x.ThreadId, x.UserId }); table.ForeignKey( name: "FK_ChatThreadReadStatuses_ChatMessages_LastReadMessageId", column: x => x.LastReadMessageId, principalTable: "ChatMessages", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_ChatThreadReadStatuses_ChatThreads_ThreadId", column: x => x.ThreadId, principalTable: "ChatThreads", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ChatThreadReadStatuses_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Archive", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Changelog = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ObjectKey = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Version = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), StorageLocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RedistributableId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ToolId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), LastVersionId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UncompressedSize = table.Column(type: "bigint", nullable: false), CompressedSize = table.Column(type: "bigint", nullable: false), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Archive", x => x.Id); table.ForeignKey( name: "FK_Archive_Archive_LastVersionId", column: x => x.LastVersionId, principalTable: "Archive", principalColumn: "Id"); table.ForeignKey( name: "FK_Archive_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Archive_Redistributables_RedistributableId", column: x => x.RedistributableId, principalTable: "Redistributables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Archive_StorageLocations_StorageLocationId", column: x => x.StorageLocationId, principalTable: "StorageLocations", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Archive_Tools_ToolId", column: x => x.ToolId, principalTable: "Tools", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Archive_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Archive_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "CategoryGame", columns: table => new { CategoriesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GamesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_CategoryGame", x => new { x.CategoriesId, x.GamesId }); table.ForeignKey( name: "FK_CategoryGame_Categories_CategoriesId", column: x => x.CategoriesId, principalTable: "Categories", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_CategoryGame_Games_GamesId", column: x => x.GamesId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "CollectionGame", columns: table => new { CollectionId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_CollectionGame", x => new { x.CollectionId, x.GameId }); table.ForeignKey( name: "FK_CollectionGame_Collections_CollectionId", column: x => x.CollectionId, principalTable: "Collections", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_CollectionGame_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameCustomField", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameCustomField", x => x.Id); table.ForeignKey( name: "FK_GameCustomField_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id"); table.ForeignKey( name: "FK_GameCustomField_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_GameCustomField_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id"); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameDeveloper", columns: table => new { GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), DeveloperId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameDeveloper", x => new { x.GameId, x.DeveloperId }); table.ForeignKey( name: "FK_GameDeveloper_Companies_DeveloperId", column: x => x.DeveloperId, principalTable: "Companies", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameDeveloper_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameExternalIds", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Provider = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ExternalId = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameExternalIds", x => x.Id); table.ForeignKey( name: "FK_GameExternalIds_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameExternalIds_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_GameExternalIds_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameGenre", columns: table => new { GamesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GenresId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameGenre", x => new { x.GamesId, x.GenresId }); table.ForeignKey( name: "FK_GameGenre_Games_GamesId", column: x => x.GamesId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameGenre_Genres_GenresId", column: x => x.GenresId, principalTable: "Genres", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GamePlatform", columns: table => new { GamesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PlatformsId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GamePlatform", x => new { x.GamesId, x.PlatformsId }); table.ForeignKey( name: "FK_GamePlatform_Games_GamesId", column: x => x.GamesId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GamePlatform_Platforms_PlatformsId", column: x => x.PlatformsId, principalTable: "Platforms", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GamePublisher", columns: table => new { GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PublisherId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GamePublisher", x => new { x.GameId, x.PublisherId }); table.ForeignKey( name: "FK_GamePublisher_Companies_PublisherId", column: x => x.PublisherId, principalTable: "Companies", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GamePublisher_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameRedistributable", columns: table => new { GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RedistributableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Options = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4") }, constraints: table => { table.PrimaryKey("PK_GameRedistributable", x => new { x.GameId, x.RedistributableId }); table.ForeignKey( name: "FK_GameRedistributable_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameRedistributable_Redistributables_RedistributableId", column: x => x.RedistributableId, principalTable: "Redistributables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameSaves", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), StorageLocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Size = table.Column(type: "bigint", nullable: false), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameSaves", x => x.Id); table.ForeignKey( name: "FK_GameSaves_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_GameSaves_StorageLocations_StorageLocationId", column: x => x.StorageLocationId, principalTable: "StorageLocations", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameSaves_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_GameSaves_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_GameSaves_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameTag", columns: table => new { GamesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), TagsId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameTag", x => new { x.GamesId, x.TagsId }); table.ForeignKey( name: "FK_GameTag_Games_GamesId", column: x => x.GamesId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameTag_Tags_TagsId", column: x => x.TagsId, principalTable: "Tags", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "GameTool", columns: table => new { GamesId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ToolsId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_GameTool", x => new { x.GamesId, x.ToolsId }); table.ForeignKey( name: "FK_GameTool_Games_GamesId", column: x => x.GamesId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_GameTool_Tools_ToolsId", column: x => x.ToolsId, principalTable: "Tools", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Issues", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Description = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ResolvedOn = table.Column(type: "datetime(6)", nullable: true), GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ResolvedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Issues", x => x.Id); table.ForeignKey( name: "FK_Issues_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Issues_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Issues_Users_ResolvedById", column: x => x.ResolvedById, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_Issues_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Keys", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Value = table.Column(type: "varchar(255)", maxLength: 255, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), AllocationMethod = table.Column(type: "int", nullable: true), ClaimedByMacAddress = table.Column(type: "varchar(17)", maxLength: 17, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClaimedByIpv4Address = table.Column(type: "varchar(15)", maxLength: 15, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClaimedByComputerName = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), ClaimedByUserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ClaimedOn = table.Column(type: "datetime(6)", nullable: true), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Keys", x => x.Id); table.ForeignKey( name: "FK_Keys_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Keys_Users_ClaimedByUserId", column: x => x.ClaimedByUserId, principalTable: "Users", principalColumn: "Id"); table.ForeignKey( name: "FK_Keys_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Keys_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "LibraryGame", columns: table => new { GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LibraryId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_LibraryGame", x => new { x.GameId, x.LibraryId }); table.ForeignKey( name: "FK_LibraryGame_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_LibraryGame_Libraries_LibraryId", column: x => x.LibraryId, principalTable: "Libraries", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Media", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), FileId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "int", nullable: false), SourceUrl = table.Column(type: "varchar(2048)", maxLength: 2048, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), MimeType = table.Column(type: "varchar(255)", maxLength: 255, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Crc32 = table.Column(type: "varchar(8)", maxLength: 8, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), SortOrder = table.Column(type: "int", nullable: false), ThumbnailId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), StorageLocationId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Media", x => x.Id); table.ForeignKey( name: "FK_Media_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Media_Media_ThumbnailId", column: x => x.ThumbnailId, principalTable: "Media", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Media_StorageLocations_StorageLocationId", column: x => x.StorageLocationId, principalTable: "StorageLocations", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Media_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Media_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Media_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "MultiplayerModes", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "int", nullable: false), NetworkProtocol = table.Column(type: "int", nullable: false), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), MinPlayers = table.Column(type: "int", nullable: false), MaxPlayers = table.Column(type: "int", nullable: false), Spectators = table.Column(type: "int", nullable: false), GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_MultiplayerModes", x => x.Id); table.ForeignKey( name: "FK_MultiplayerModes_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_MultiplayerModes_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_MultiplayerModes_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PlaySessions", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UserId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Start = table.Column(type: "datetime(6)", nullable: true), End = table.Column(type: "datetime(6)", nullable: true), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PlaySessions", x => x.Id); table.ForeignKey( name: "FK_PlaySessions_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PlaySessions_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_PlaySessions_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_PlaySessions_Users_UserId", column: x => x.UserId, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Ratings", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), Source = table.Column(type: "varchar(128)", maxLength: 128, nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Value = table.Column(type: "float", nullable: false), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Ratings", x => x.Id); table.ForeignKey( name: "FK_Ratings_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Ratings_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Ratings_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "SavePaths", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Type = table.Column(type: "int", nullable: false), Path = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), WorkingDirectory = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), IsRegex = table.Column(type: "tinyint(1)", nullable: false), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_SavePaths", x => x.Id); table.ForeignKey( name: "FK_SavePaths_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_SavePaths_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_SavePaths_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Servers", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Engine = table.Column(type: "int", nullable: false), Path = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Arguments = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), WorkingDirectory = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), OnStartScriptPath = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), OnStopScriptPath = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), DockerHostId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RemoteHostId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RemoteServerId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ContainerId = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Host = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Port = table.Column(type: "int", nullable: false), UseShellExecute = table.Column(type: "tinyint(1)", nullable: false), ProcessTerminationMethod = table.Column(type: "int", nullable: false), Autostart = table.Column(type: "tinyint(1)", nullable: false), AutostartMethod = table.Column(type: "int", nullable: false), AutostartDelay = table.Column(type: "int", nullable: false), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Servers", x => x.Id); table.ForeignKey( name: "FK_Servers_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Servers_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Servers_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PageGame", columns: table => new { GameId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), PageId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PageGame", x => new { x.GameId, x.PageId }); table.ForeignKey( name: "FK_PageGame_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PageGame_Pages_PageId", column: x => x.PageId, principalTable: "Pages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PageRedistributable", columns: table => new { PageId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), RedistributableId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PageRedistributable", x => new { x.PageId, x.RedistributableId }); table.ForeignKey( name: "FK_PageRedistributable_Pages_PageId", column: x => x.PageId, principalTable: "Pages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PageRedistributable_Redistributables_RedistributableId", column: x => x.RedistributableId, principalTable: "Redistributables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Actions", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Arguments = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Path = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), WorkingDirectory = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), PrimaryAction = table.Column(type: "tinyint(1)", nullable: false), SortOrder = table.Column(type: "int", nullable: false), OptionOverrides = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ServerId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ToolId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Actions", x => x.Id); table.ForeignKey( name: "FK_Actions_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Actions_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Actions_Tools_ToolId", column: x => x.ToolId, principalTable: "Tools", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Actions_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Actions_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "PageServer", columns: table => new { PageId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), ServerId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_PageServer", x => new { x.PageId, x.ServerId }); table.ForeignKey( name: "FK_PageServer_Pages_PageId", column: x => x.PageId, principalTable: "Pages", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_PageServer_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "Scripts", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Description = table.Column(type: "longtext", nullable: true) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "int", nullable: false), Contents = table.Column(type: "longtext", nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), RequiresAdmin = table.Column(type: "tinyint(1)", nullable: false), GameId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), RedistributableId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ToolId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), ServerId = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_Scripts", x => x.Id); table.ForeignKey( name: "FK_Scripts_Games_GameId", column: x => x.GameId, principalTable: "Games", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Scripts_Redistributables_RedistributableId", column: x => x.RedistributableId, principalTable: "Redistributables", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Scripts_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Scripts_Tools_ToolId", column: x => x.ToolId, principalTable: "Tools", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_Scripts_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_Scripts_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServerConsoles", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), Name = table.Column(type: "varchar(64)", maxLength: 64, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Type = table.Column(type: "int", nullable: false), Path = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Host = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Port = table.Column(type: "int", nullable: true), Password = table.Column(type: "varchar(128)", maxLength: 128, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ServerId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ServerConsoles", x => x.Id); table.ForeignKey( name: "FK_ServerConsoles_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ServerConsoles_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_ServerConsoles_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateTable( name: "ServerHttpPath", columns: table => new { Id = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), LocalPath = table.Column(type: "varchar(1024)", maxLength: 1024, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), Path = table.Column(type: "varchar(256)", maxLength: 256, nullable: false) .Annotation("MySql:CharSet", "utf8mb4"), ServerId = table.Column(type: "char(36)", nullable: false, collation: "ascii_general_ci"), CreatedOn = table.Column(type: "datetime(6)", nullable: false), CreatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci"), UpdatedOn = table.Column(type: "datetime(6)", nullable: false), UpdatedById = table.Column(type: "char(36)", nullable: true, collation: "ascii_general_ci") }, constraints: table => { table.PrimaryKey("PK_ServerHttpPath", x => x.Id); table.ForeignKey( name: "FK_ServerHttpPath_Servers_ServerId", column: x => x.ServerId, principalTable: "Servers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( name: "FK_ServerHttpPath_Users_CreatedById", column: x => x.CreatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); table.ForeignKey( name: "FK_ServerHttpPath_Users_UpdatedById", column: x => x.UpdatedById, principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.SetNull); }) .Annotation("MySql:CharSet", "utf8mb4"); migrationBuilder.CreateIndex( name: "IX_Actions_CreatedById", table: "Actions", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Actions_GameId", table: "Actions", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Actions_ServerId", table: "Actions", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_Actions_ToolId", table: "Actions", column: "ToolId"); migrationBuilder.CreateIndex( name: "IX_Actions_UpdatedById", table: "Actions", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Archive_CreatedById", table: "Archive", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Archive_GameId", table: "Archive", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Archive_LastVersionId", table: "Archive", column: "LastVersionId"); migrationBuilder.CreateIndex( name: "IX_Archive_RedistributableId", table: "Archive", column: "RedistributableId"); migrationBuilder.CreateIndex( name: "IX_Archive_StorageLocationId", table: "Archive", column: "StorageLocationId"); migrationBuilder.CreateIndex( name: "IX_Archive_ToolId", table: "Archive", column: "ToolId"); migrationBuilder.CreateIndex( name: "IX_Archive_UpdatedById", table: "Archive", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Categories_CreatedById", table: "Categories", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Categories_ParentId", table: "Categories", column: "ParentId"); migrationBuilder.CreateIndex( name: "IX_Categories_UpdatedById", table: "Categories", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_CategoryGame_GamesId", table: "CategoryGame", column: "GamesId"); migrationBuilder.CreateIndex( name: "IX_ChatMessages_CreatedById", table: "ChatMessages", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_ChatMessages_ThreadId", table: "ChatMessages", column: "ThreadId"); migrationBuilder.CreateIndex( name: "IX_ChatMessages_UpdatedById", table: "ChatMessages", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_ChatThreadReadStatuses_LastReadMessageId", table: "ChatThreadReadStatuses", column: "LastReadMessageId"); migrationBuilder.CreateIndex( name: "IX_ChatThreadReadStatuses_UserId", table: "ChatThreadReadStatuses", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_ChatThreads_CreatedById", table: "ChatThreads", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_ChatThreads_UpdatedById", table: "ChatThreads", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_ChatThreadUser_ParticipantsId", table: "ChatThreadUser", column: "ParticipantsId"); migrationBuilder.CreateIndex( name: "IX_CollectionGame_GameId", table: "CollectionGame", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Collections_CreatedById", table: "Collections", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Collections_UpdatedById", table: "Collections", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Companies_CreatedById", table: "Companies", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Companies_UpdatedById", table: "Companies", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Engines_CreatedById", table: "Engines", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Engines_UpdatedById", table: "Engines", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_GameCustomField_CreatedById", table: "GameCustomField", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_GameCustomField_GameId", table: "GameCustomField", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_GameCustomField_UpdatedById", table: "GameCustomField", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_GameDeveloper_DeveloperId", table: "GameDeveloper", column: "DeveloperId"); migrationBuilder.CreateIndex( name: "IX_GameExternalIds_CreatedById", table: "GameExternalIds", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_GameExternalIds_GameId", table: "GameExternalIds", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_GameExternalIds_UpdatedById", table: "GameExternalIds", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_GameGenre_GenresId", table: "GameGenre", column: "GenresId"); migrationBuilder.CreateIndex( name: "IX_GamePlatform_PlatformsId", table: "GamePlatform", column: "PlatformsId"); migrationBuilder.CreateIndex( name: "IX_GamePublisher_PublisherId", table: "GamePublisher", column: "PublisherId"); migrationBuilder.CreateIndex( name: "IX_GameRedistributable_RedistributableId", table: "GameRedistributable", column: "RedistributableId"); migrationBuilder.CreateIndex( name: "IX_Games_BaseGameId", table: "Games", column: "BaseGameId"); migrationBuilder.CreateIndex( name: "IX_Games_CreatedById", table: "Games", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Games_EngineId", table: "Games", column: "EngineId"); migrationBuilder.CreateIndex( name: "IX_Games_UpdatedById", table: "Games", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_GameSaves_CreatedById", table: "GameSaves", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_GameSaves_GameId", table: "GameSaves", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_GameSaves_StorageLocationId", table: "GameSaves", column: "StorageLocationId"); migrationBuilder.CreateIndex( name: "IX_GameSaves_UpdatedById", table: "GameSaves", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_GameSaves_UserId", table: "GameSaves", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_GameTag_TagsId", table: "GameTag", column: "TagsId"); migrationBuilder.CreateIndex( name: "IX_GameTool_ToolsId", table: "GameTool", column: "ToolsId"); migrationBuilder.CreateIndex( name: "IX_Genres_CreatedById", table: "Genres", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Genres_UpdatedById", table: "Genres", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Issues_CreatedById", table: "Issues", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Issues_GameId", table: "Issues", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Issues_ResolvedById", table: "Issues", column: "ResolvedById"); migrationBuilder.CreateIndex( name: "IX_Issues_UpdatedById", table: "Issues", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Keys_ClaimedByUserId", table: "Keys", column: "ClaimedByUserId"); migrationBuilder.CreateIndex( name: "IX_Keys_CreatedById", table: "Keys", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Keys_GameId", table: "Keys", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Keys_UpdatedById", table: "Keys", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Libraries_CreatedById", table: "Libraries", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Libraries_UpdatedById", table: "Libraries", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Libraries_UserId", table: "Libraries", column: "UserId", unique: true); migrationBuilder.CreateIndex( name: "IX_LibraryGame_LibraryId", table: "LibraryGame", column: "LibraryId"); migrationBuilder.CreateIndex( name: "IX_Media_CreatedById", table: "Media", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Media_GameId", table: "Media", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Media_StorageLocationId", table: "Media", column: "StorageLocationId"); migrationBuilder.CreateIndex( name: "IX_Media_ThumbnailId", table: "Media", column: "ThumbnailId", unique: true); migrationBuilder.CreateIndex( name: "IX_Media_UpdatedById", table: "Media", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Media_UserId", table: "Media", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_MultiplayerModes_CreatedById", table: "MultiplayerModes", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_MultiplayerModes_GameId", table: "MultiplayerModes", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_MultiplayerModes_UpdatedById", table: "MultiplayerModes", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_PageGame_PageId", table: "PageGame", column: "PageId"); migrationBuilder.CreateIndex( name: "IX_PageRedistributable_RedistributableId", table: "PageRedistributable", column: "RedistributableId"); migrationBuilder.CreateIndex( name: "IX_Pages_CreatedById", table: "Pages", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Pages_ParentId", table: "Pages", column: "ParentId"); migrationBuilder.CreateIndex( name: "IX_Pages_ToolId", table: "Pages", column: "ToolId"); migrationBuilder.CreateIndex( name: "IX_Pages_UpdatedById", table: "Pages", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_PageServer_ServerId", table: "PageServer", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_Platforms_CreatedById", table: "Platforms", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Platforms_UpdatedById", table: "Platforms", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_PlaySessions_CreatedById", table: "PlaySessions", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_PlaySessions_GameId", table: "PlaySessions", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_PlaySessions_UpdatedById", table: "PlaySessions", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_PlaySessions_UserId", table: "PlaySessions", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_Ratings_CreatedById", table: "Ratings", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Ratings_GameId", table: "Ratings", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Ratings_UpdatedById", table: "Ratings", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Redistributables_CreatedById", table: "Redistributables", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Redistributables_UpdatedById", table: "Redistributables", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_RoleClaims_RoleId", table: "RoleClaims", column: "RoleId"); migrationBuilder.CreateIndex( name: "IX_RoleCollection_RoleId", table: "RoleCollection", column: "RoleId"); migrationBuilder.CreateIndex( name: "IX_Roles_CreatedById", table: "Roles", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Roles_UpdatedById", table: "Roles", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "RoleNameIndex", table: "Roles", column: "NormalizedName", unique: true); migrationBuilder.CreateIndex( name: "IX_SavePaths_CreatedById", table: "SavePaths", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_SavePaths_GameId", table: "SavePaths", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_SavePaths_UpdatedById", table: "SavePaths", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Scripts_CreatedById", table: "Scripts", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Scripts_GameId", table: "Scripts", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Scripts_RedistributableId", table: "Scripts", column: "RedistributableId"); migrationBuilder.CreateIndex( name: "IX_Scripts_ServerId", table: "Scripts", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_Scripts_ToolId", table: "Scripts", column: "ToolId"); migrationBuilder.CreateIndex( name: "IX_Scripts_UpdatedById", table: "Scripts", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_ServerConsoles_CreatedById", table: "ServerConsoles", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_ServerConsoles_ServerId", table: "ServerConsoles", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_ServerConsoles_UpdatedById", table: "ServerConsoles", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_ServerHttpPath_CreatedById", table: "ServerHttpPath", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_ServerHttpPath_ServerId", table: "ServerHttpPath", column: "ServerId"); migrationBuilder.CreateIndex( name: "IX_ServerHttpPath_UpdatedById", table: "ServerHttpPath", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Servers_CreatedById", table: "Servers", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Servers_GameId", table: "Servers", column: "GameId"); migrationBuilder.CreateIndex( name: "IX_Servers_UpdatedById", table: "Servers", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_StorageLocations_CreatedById", table: "StorageLocations", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_StorageLocations_UpdatedById", table: "StorageLocations", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Tags_CreatedById", table: "Tags", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Tags_UpdatedById", table: "Tags", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_Tools_CreatedById", table: "Tools", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Tools_UpdatedById", table: "Tools", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_UserClaims_UserId", table: "UserClaims", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_UserCustomField_CreatedById", table: "UserCustomField", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_UserCustomField_UpdatedById", table: "UserCustomField", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "IX_UserCustomField_UserId", table: "UserCustomField", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_UserLogins_UserId", table: "UserLogins", column: "UserId"); migrationBuilder.CreateIndex( name: "IX_UserRoles_RoleId", table: "UserRoles", column: "RoleId"); migrationBuilder.CreateIndex( name: "EmailIndex", table: "Users", column: "NormalizedEmail"); migrationBuilder.CreateIndex( name: "IX_Users_CreatedById", table: "Users", column: "CreatedById"); migrationBuilder.CreateIndex( name: "IX_Users_UpdatedById", table: "Users", column: "UpdatedById"); migrationBuilder.CreateIndex( name: "UserNameIndex", table: "Users", column: "NormalizedUserName", unique: true); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Actions"); migrationBuilder.DropTable( name: "Archive"); migrationBuilder.DropTable( name: "CategoryGame"); migrationBuilder.DropTable( name: "ChatThreadReadStatuses"); migrationBuilder.DropTable( name: "ChatThreadUser"); migrationBuilder.DropTable( name: "CollectionGame"); migrationBuilder.DropTable( name: "GameCustomField"); migrationBuilder.DropTable( name: "GameDeveloper"); migrationBuilder.DropTable( name: "GameExternalIds"); migrationBuilder.DropTable( name: "GameGenre"); migrationBuilder.DropTable( name: "GamePlatform"); migrationBuilder.DropTable( name: "GamePublisher"); migrationBuilder.DropTable( name: "GameRedistributable"); migrationBuilder.DropTable( name: "GameSaves"); migrationBuilder.DropTable( name: "GameTag"); migrationBuilder.DropTable( name: "GameTool"); migrationBuilder.DropTable( name: "Issues"); migrationBuilder.DropTable( name: "Keys"); migrationBuilder.DropTable( name: "LibraryGame"); migrationBuilder.DropTable( name: "Media"); migrationBuilder.DropTable( name: "MultiplayerModes"); migrationBuilder.DropTable( name: "PageGame"); migrationBuilder.DropTable( name: "PageRedistributable"); migrationBuilder.DropTable( name: "PageServer"); migrationBuilder.DropTable( name: "PlaySessions"); migrationBuilder.DropTable( name: "Ratings"); migrationBuilder.DropTable( name: "RoleClaims"); migrationBuilder.DropTable( name: "RoleCollection"); migrationBuilder.DropTable( name: "SavePaths"); migrationBuilder.DropTable( name: "Scripts"); migrationBuilder.DropTable( name: "ServerConsoles"); migrationBuilder.DropTable( name: "ServerHttpPath"); migrationBuilder.DropTable( name: "UserClaims"); migrationBuilder.DropTable( name: "UserCustomField"); migrationBuilder.DropTable( name: "UserLogins"); migrationBuilder.DropTable( name: "UserRoles"); migrationBuilder.DropTable( name: "UserTokens"); migrationBuilder.DropTable( name: "Categories"); migrationBuilder.DropTable( name: "ChatMessages"); migrationBuilder.DropTable( name: "Genres"); migrationBuilder.DropTable( name: "Platforms"); migrationBuilder.DropTable( name: "Companies"); migrationBuilder.DropTable( name: "Tags"); migrationBuilder.DropTable( name: "Libraries"); migrationBuilder.DropTable( name: "StorageLocations"); migrationBuilder.DropTable( name: "Pages"); migrationBuilder.DropTable( name: "Collections"); migrationBuilder.DropTable( name: "Redistributables"); migrationBuilder.DropTable( name: "Servers"); migrationBuilder.DropTable( name: "Roles"); migrationBuilder.DropTable( name: "ChatThreads"); migrationBuilder.DropTable( name: "Tools"); migrationBuilder.DropTable( name: "Games"); migrationBuilder.DropTable( name: "Engines"); migrationBuilder.DropTable( name: "Users"); } } }