diff --git a/.azuredevops/pipelines/publish-job.yml b/.azuredevops/pipelines/publish-job.yml index 23449f30c..24c24d385 100644 --- a/.azuredevops/pipelines/publish-job.yml +++ b/.azuredevops/pipelines/publish-job.yml @@ -48,6 +48,7 @@ stages: - stage: deploy jobs: - job: + condition: and(succeeded(), eq(variables.isMain, true)) steps: - task: DownloadPipelineArtifact@2 inputs: @@ -90,4 +91,3 @@ stages: isPreRelease: true changeLogCompareToRelease: 'lastNonDraftRelease' changeLogType: 'commitBased' - condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/feature/v4')) diff --git a/.azuredevops/pipelines/templates/variables.yml b/.azuredevops/pipelines/templates/variables.yml index 737f7b9d1..507746641 100644 --- a/.azuredevops/pipelines/templates/variables.yml +++ b/.azuredevops/pipelines/templates/variables.yml @@ -4,7 +4,7 @@ variables: - name: "vmImage" value: "ubuntu-latest" - + - name: "Solution" value: "**/*.sln" @@ -24,4 +24,7 @@ variables: value: "$(Build.SourcesDirectory)/src/Ombi/ClientApp/" - name: "BuildVersion" - value: "4.0.$(Build.BuildId)" \ No newline at end of file + value: "4.0.$(Build.BuildId)" + + - name: isMain + value: $[eq(variables['Build.SourceBranch'], 'refs/heads/feature/v4')] \ No newline at end of file diff --git a/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs b/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs index ae533b901..7dc1afb66 100644 --- a/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs +++ b/src/Ombi.Store/Migrations/OmbiMySql/20200218230644_MobileDevices.cs @@ -8,34 +8,34 @@ namespace Ombi.Store.Migrations.OmbiMySql { protected override void Up(MigrationBuilder migrationBuilder) { - migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` ( - `Id` int NOT NULL AUTO_INCREMENT, - `Token` longtext CHARACTER SET utf8mb4 NULL, - `UserId` varchar(255) CHARACTER SET utf8mb4 NOT NULL, - `AddedAt` datetime(6) NOT NULL, - CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`), - CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT -);"); +// migrationBuilder.Sql(@"CREATE TABLE `MobileDevices` ( +// `Id` int NOT NULL AUTO_INCREMENT, +// `Token` longtext CHARACTER SET utf8mb4 NULL, +// `UserId` varchar(255) CHARACTER SET utf8mb4 NOT NULL, +// `AddedAt` datetime(6) NOT NULL, +// CONSTRAINT `PK_MobileDevices` PRIMARY KEY (`Id`), +// CONSTRAINT `FK_MobileDevices_AspNetUsers_UserId` FOREIGN KEY (`UserId`) REFERENCES `AspNetUsers` (`Id`) ON DELETE RESTRICT +//);"); - //migrationBuilder.CreateTable( - // name: "MobileDevices", - // columns: table => new - // { - // Id = table.Column(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - // Token = table.Column(maxLength: 256, nullable: true), - // UserId = table.Column(maxLength: 255, nullable: false), - // AddedAt = table.Column(maxLength: 256, nullable: false), - // }, - // constraints: table => - // { - // table.PrimaryKey("PK_MobileDevices", x => x.Id); - // table.ForeignKey( - // name: "FK_MobileDevices_AspNetUsers_UserId", - // column: x => x.UserId, - // principalTable: "AspNetUsers", - // principalColumn: "Id", - // onDelete: ReferentialAction.Restrict); - // }); + migrationBuilder.CreateTable( + name: "MobileDevices", + columns: table => new + { + Id = table.Column(nullable: false).Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Token = table.Column(maxLength: 256, nullable: true), + UserId = table.Column(maxLength: 255, nullable: false), + AddedAt = table.Column(maxLength: 256, nullable: false), + }, + constraints: table => + { + table.PrimaryKey("PK_MobileDevices", x => x.Id); + table.ForeignKey( + name: "FK_MobileDevices_AspNetUsers_UserId", + column: x => x.UserId, + principalTable: "AspNetUsers", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); migrationBuilder.CreateIndex( diff --git a/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.Designer.cs b/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.Designer.cs new file mode 100644 index 000000000..c6251941f --- /dev/null +++ b/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.Designer.cs @@ -0,0 +1,1152 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Ombi.Store.Context.MySql; + +namespace Ombi.Store.Migrations.OmbiMySql +{ + [DbContext(typeof(OmbiMySqlContext))] + [Migration("20200829205234_Charset")] + partial class Charset + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "3.1.1") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("Name") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedName") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.HasKey("Id"); + + b.HasIndex("NormalizedName") + .IsUnique() + .HasName("RoleNameIndex"); + + b.ToTable("AspNetRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("RoleId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetRoleClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ClaimType") + .HasColumnType("longtext"); + + b.Property("ClaimValue") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserClaims"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.Property("LoginProvider") + .HasColumnType("varchar(255)"); + + b.Property("ProviderKey") + .HasColumnType("varchar(255)"); + + b.Property("ProviderDisplayName") + .HasColumnType("longtext"); + + b.Property("UserId") + .IsRequired() + .HasColumnType("varchar(255)"); + + b.HasKey("LoginProvider", "ProviderKey"); + + b.HasIndex("UserId"); + + b.ToTable("AspNetUserLogins"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("RoleId") + .HasColumnType("varchar(255)"); + + b.HasKey("UserId", "RoleId"); + + b.HasIndex("RoleId"); + + b.ToTable("AspNetUserRoles"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("LoginProvider") + .HasColumnType("varchar(255)"); + + b.Property("Name") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("UserId", "LoginProvider", "Name"); + + b.ToTable("AspNetUserTokens"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Audit", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AuditArea") + .HasColumnType("int"); + + b.Property("AuditType") + .HasColumnType("int"); + + b.Property("DateTime") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("User") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("Audit"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AddedAt") + .HasColumnType("datetime(6)"); + + b.Property("Token") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("MobileDevices"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationTemplates", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Agent") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("Message") + .HasColumnType("longtext"); + + b.Property("NotificationType") + .HasColumnType("int"); + + b.Property("Subject") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("NotificationTemplates"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AddedAt") + .HasColumnType("datetime(6)"); + + b.Property("PlayerId") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("NotificationUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => + { + b.Property("Id") + .HasColumnType("varchar(255)"); + + b.Property("AccessFailedCount") + .HasColumnType("int"); + + b.Property("Alias") + .HasColumnType("longtext"); + + b.Property("ConcurrencyStamp") + .IsConcurrencyToken() + .HasColumnType("longtext"); + + b.Property("Email") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.Property("EmailConfirmed") + .HasColumnType("tinyint(1)"); + + b.Property("EpisodeRequestLimit") + .HasColumnType("int"); + + b.Property("Language") + .HasColumnType("longtext"); + + b.Property("LastLoggedIn") + .HasColumnType("datetime(6)"); + + b.Property("LockoutEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("LockoutEnd") + .HasColumnType("datetime(6)"); + + b.Property("MovieRequestLimit") + .HasColumnType("int"); + + b.Property("MusicRequestLimit") + .HasColumnType("int"); + + b.Property("NormalizedEmail") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.Property("NormalizedUserName") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.Property("PasswordHash") + .HasColumnType("longtext"); + + b.Property("PhoneNumber") + .HasColumnType("longtext"); + + b.Property("PhoneNumberConfirmed") + .HasColumnType("tinyint(1)"); + + b.Property("ProviderUserId") + .HasColumnType("longtext"); + + b.Property("SecurityStamp") + .HasColumnType("longtext"); + + b.Property("TwoFactorEnabled") + .HasColumnType("tinyint(1)"); + + b.Property("UserAccessToken") + .HasColumnType("longtext"); + + b.Property("UserName") + .HasColumnType("varchar(256)") + .HasMaxLength(256); + + b.Property("UserType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("NormalizedEmail") + .HasName("EmailIndex"); + + b.HasIndex("NormalizedUserName") + .IsUnique() + .HasName("UserNameIndex"); + + b.ToTable("AspNetUsers"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RecentlyAddedLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AddedAt") + .HasColumnType("datetime(6)"); + + b.Property("AlbumId") + .HasColumnType("longtext"); + + b.Property("ContentId") + .HasColumnType("int"); + + b.Property("ContentType") + .HasColumnType("int"); + + b.Property("EpisodeNumber") + .HasColumnType("int"); + + b.Property("SeasonNumber") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("RecentlyAddedLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestQueue", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Completed") + .HasColumnType("datetime(6)"); + + b.Property("Dts") + .HasColumnType("datetime(6)"); + + b.Property("Error") + .HasColumnType("longtext"); + + b.Property("RequestId") + .HasColumnType("int"); + + b.Property("RetryCount") + .HasColumnType("int"); + + b.Property("Type") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("RequestQueue"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("RequestId") + .HasColumnType("int"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestSubscription"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Approved") + .HasColumnType("tinyint(1)"); + + b.Property("ArtistName") + .HasColumnType("longtext"); + + b.Property("Available") + .HasColumnType("tinyint(1)"); + + b.Property("Cover") + .HasColumnType("longtext"); + + b.Property("Denied") + .HasColumnType("tinyint(1)"); + + b.Property("DeniedReason") + .HasColumnType("longtext"); + + b.Property("Disk") + .HasColumnType("longtext"); + + b.Property("ForeignAlbumId") + .HasColumnType("longtext"); + + b.Property("ForeignArtistId") + .HasColumnType("longtext"); + + b.Property("MarkedAsApproved") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsAvailable") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsDenied") + .HasColumnType("datetime(6)"); + + b.Property("Rating") + .HasColumnType("decimal(65,30)"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("RequestedByAlias") + .HasColumnType("longtext"); + + b.Property("RequestedDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestedUserId") + .HasColumnType("varchar(255)"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("AlbumRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Approved") + .HasColumnType("tinyint(1)"); + + b.Property("Available") + .HasColumnType("tinyint(1)"); + + b.Property("Denied") + .HasColumnType("tinyint(1)"); + + b.Property("DeniedReason") + .HasColumnType("longtext"); + + b.Property("IssueId") + .HasColumnType("int"); + + b.Property("MarkedAsApproved") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsAvailable") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsDenied") + .HasColumnType("datetime(6)"); + + b.Property("ParentRequestId") + .HasColumnType("int"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("RequestedByAlias") + .HasColumnType("longtext"); + + b.Property("RequestedDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestedUserId") + .HasColumnType("varchar(255)"); + + b.Property("SeriesType") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("ParentRequestId"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("ChildRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueCategory", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.ToTable("IssueCategory"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Comment") + .HasColumnType("longtext"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("IssuesId") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("IssuesId"); + + b.HasIndex("UserId"); + + b.ToTable("IssueComments"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("CreatedDate") + .HasColumnType("datetime(6)"); + + b.Property("Description") + .HasColumnType("longtext"); + + b.Property("IssueCategoryId") + .HasColumnType("int"); + + b.Property("IssueId") + .HasColumnType("int"); + + b.Property("ProviderId") + .HasColumnType("longtext"); + + b.Property("RequestId") + .HasColumnType("int"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("ResovledDate") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("int"); + + b.Property("Subject") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("UserReportedId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("IssueCategoryId"); + + b.HasIndex("IssueId"); + + b.HasIndex("UserReportedId"); + + b.ToTable("Issues"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Approved") + .HasColumnType("tinyint(1)"); + + b.Property("Available") + .HasColumnType("tinyint(1)"); + + b.Property("Background") + .HasColumnType("longtext"); + + b.Property("Denied") + .HasColumnType("tinyint(1)"); + + b.Property("DeniedReason") + .HasColumnType("longtext"); + + b.Property("DigitalReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("ImdbId") + .HasColumnType("longtext"); + + b.Property("IssueId") + .HasColumnType("int"); + + b.Property("LangCode") + .HasColumnType("longtext"); + + b.Property("MarkedAsApproved") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsAvailable") + .HasColumnType("datetime(6)"); + + b.Property("MarkedAsDenied") + .HasColumnType("datetime(6)"); + + b.Property("Overview") + .HasColumnType("longtext"); + + b.Property("PosterPath") + .HasColumnType("longtext"); + + b.Property("QualityOverride") + .HasColumnType("int"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("RequestedByAlias") + .HasColumnType("longtext"); + + b.Property("RequestedDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestedUserId") + .HasColumnType("varchar(255)"); + + b.Property("RootPathOverride") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("TheMovieDbId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("RequestedUserId"); + + b.ToTable("MovieRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("EpisodeCount") + .HasColumnType("int"); + + b.Property("RequestDate") + .HasColumnType("datetime(6)"); + + b.Property("RequestId") + .HasColumnType("int"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("RequestLog"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.TvRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Background") + .HasColumnType("longtext"); + + b.Property("ImdbId") + .HasColumnType("longtext"); + + b.Property("Overview") + .HasColumnType("longtext"); + + b.Property("PosterPath") + .HasColumnType("longtext"); + + b.Property("QualityOverride") + .HasColumnType("int"); + + b.Property("ReleaseDate") + .HasColumnType("datetime(6)"); + + b.Property("RootFolder") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("longtext"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("TotalSeasons") + .HasColumnType("int"); + + b.Property("TvDbId") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.ToTable("TvRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Token") + .HasColumnType("longtext"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Tokens"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Agent") + .HasColumnType("int"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserNotificationPreferences"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("RadarrQualityProfile") + .HasColumnType("int"); + + b.Property("RadarrRootPath") + .HasColumnType("int"); + + b.Property("SonarrQualityProfile") + .HasColumnType("int"); + + b.Property("SonarrQualityProfileAnime") + .HasColumnType("int"); + + b.Property("SonarrRootPath") + .HasColumnType("int"); + + b.Property("SonarrRootPathAnime") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("UserQualityProfiles"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("Deleted") + .HasColumnType("tinyint(1)"); + + b.Property("RequestId") + .HasColumnType("int"); + + b.Property("RequestType") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("varchar(255)"); + + b.Property("VoteType") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Votes"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("AirDate") + .HasColumnType("datetime(6)"); + + b.Property("Approved") + .HasColumnType("tinyint(1)"); + + b.Property("Available") + .HasColumnType("tinyint(1)"); + + b.Property("EpisodeNumber") + .HasColumnType("int"); + + b.Property("Requested") + .HasColumnType("tinyint(1)"); + + b.Property("SeasonId") + .HasColumnType("int"); + + b.Property("Title") + .HasColumnType("longtext"); + + b.Property("Url") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("SeasonId"); + + b.ToTable("EpisodeRequests"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("int"); + + b.Property("ChildRequestId") + .HasColumnType("int"); + + b.Property("SeasonNumber") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("ChildRequestId"); + + b.ToTable("SeasonRequests"); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => + { + b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null) + .WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", null) + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Ombi.Store.Entities.MobileDevices", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.NotificationUserId", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("NotificationUserIds") + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.RequestSubscription", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.AlbumRequest", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.ChildRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.TvRequests", "ParentRequest") + .WithMany("ChildRequests") + .HasForeignKey("ParentRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.IssueComments", b => + { + b.HasOne("Ombi.Store.Entities.Requests.Issues", "Issues") + .WithMany("Comments") + .HasForeignKey("IssuesId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.Issues", b => + { + b.HasOne("Ombi.Store.Entities.Requests.IssueCategory", "IssueCategory") + .WithMany() + .HasForeignKey("IssueCategoryId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.Requests.MovieRequests", null) + .WithMany("Issues") + .HasForeignKey("IssueId"); + + b.HasOne("Ombi.Store.Entities.OmbiUser", "UserReported") + .WithMany() + .HasForeignKey("UserReportedId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.MovieRequests", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "RequestedUser") + .WithMany() + .HasForeignKey("RequestedUserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Requests.RequestLog", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Tokens", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserNotificationPreferences", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany("UserNotificationPreferences") + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.UserQualityProfiles", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Entities.Votes", b => + { + b.HasOne("Ombi.Store.Entities.OmbiUser", "User") + .WithMany() + .HasForeignKey("UserId"); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.EpisodeRequests", b => + { + b.HasOne("Ombi.Store.Repository.Requests.SeasonRequests", "Season") + .WithMany("Episodes") + .HasForeignKey("SeasonId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Ombi.Store.Repository.Requests.SeasonRequests", b => + { + b.HasOne("Ombi.Store.Entities.Requests.ChildRequests", "ChildRequest") + .WithMany("SeasonRequests") + .HasForeignKey("ChildRequestId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.cs b/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.cs new file mode 100644 index 000000000..d907bc0e1 --- /dev/null +++ b/src/Ombi.Store/Migrations/OmbiMySql/20200829205234_Charset.cs @@ -0,0 +1,1457 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +namespace Ombi.Store.Migrations.OmbiMySql +{ + public partial class Charset : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.Sql("SET FOREIGN_KEY_CHECKS=0;"); + migrationBuilder.AlterColumn( + name: "UserId", + table: "Votes", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "UserQualityProfiles", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "UserNotificationPreferences", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "UserNotificationPreferences", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Status", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PosterPath", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Overview", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ImdbId", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Background", + table: "TvRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Tokens", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Token", + table: "Tokens", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "RequestSubscription", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Error", + table: "RequestQueue", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "RequestLog", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "AlbumId", + table: "RecentlyAddedLog", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "NotificationUserId", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PlayerId", + table: "NotificationUserId", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Subject", + table: "NotificationTemplates", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Message", + table: "NotificationTemplates", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Status", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PosterPath", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Overview", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LangCode", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ImdbId", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Background", + table: "MovieRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "MobileDevices", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Token", + table: "MobileDevices", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserReportedId", + table: "Issues", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Issues", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Subject", + table: "Issues", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderId", + table: "Issues", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Issues", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "IssueComments", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Comment", + table: "IssueComments", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "IssueCategory", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Url", + table: "EpisodeRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "EpisodeRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "ChildRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "ChildRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "ChildRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "ChildRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "User", + table: "Audit", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Audit", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "AspNetUserTokens", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Name", + table: "AspNetUserTokens", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "AspNetUserTokens", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserTokens", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "AspNetUsers", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserAccessToken", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "SecurityStamp", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderUserId", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedUserName", + table: "AspNetUsers", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedEmail", + table: "AspNetUsers", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Language", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Email", + table: "AspNetUsers", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Alias", + table: "AspNetUsers", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AspNetUsers", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "AspNetUserRoles", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserRoles", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserLogins", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ProviderDisplayName", + table: "AspNetUserLogins", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderKey", + table: "AspNetUserLogins", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "AspNetUserLogins", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserClaims", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "AspNetUserClaims", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "AspNetUserClaims", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedName", + table: "AspNetRoles", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Name", + table: "AspNetRoles", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(256) CHARACTER SET utf8mb4", + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AspNetRoles", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AspNetRoles", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "AspNetRoleClaims", + nullable: false, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4"); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "AspNetRoleClaims", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "AspNetRoleClaims", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "varchar(255) CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ForeignArtistId", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ForeignAlbumId", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Disk", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Cover", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ArtistName", + table: "AlbumRequests", + nullable: true, + oldClrType: typeof(string), + oldType: "longtext CHARACTER SET utf8mb4", + oldNullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "UserId", + table: "Votes", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "UserQualityProfiles", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "UserNotificationPreferences", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "UserNotificationPreferences", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Status", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PosterPath", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Overview", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ImdbId", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Background", + table: "TvRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "Tokens", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Token", + table: "Tokens", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "RequestSubscription", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Error", + table: "RequestQueue", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "RequestLog", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "AlbumId", + table: "RecentlyAddedLog", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "NotificationUserId", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PlayerId", + table: "NotificationUserId", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Subject", + table: "NotificationTemplates", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Message", + table: "NotificationTemplates", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Status", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "MovieRequests", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PosterPath", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Overview", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "LangCode", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ImdbId", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Background", + table: "MovieRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "MobileDevices", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Token", + table: "MobileDevices", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserReportedId", + table: "Issues", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "Issues", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Subject", + table: "Issues", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderId", + table: "Issues", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Issues", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "IssueComments", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Comment", + table: "IssueComments", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "IssueCategory", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Url", + table: "EpisodeRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "EpisodeRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "ChildRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "ChildRequests", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "ChildRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "ChildRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "User", + table: "Audit", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Description", + table: "Audit", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Value", + table: "AspNetUserTokens", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Name", + table: "AspNetUserTokens", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "AspNetUserTokens", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserTokens", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "UserName", + table: "AspNetUsers", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "UserAccessToken", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "SecurityStamp", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderUserId", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "PasswordHash", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedUserName", + table: "AspNetUsers", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedEmail", + table: "AspNetUsers", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Language", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Email", + table: "AspNetUsers", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Alias", + table: "AspNetUsers", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AspNetUsers", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "AspNetUserRoles", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserRoles", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserLogins", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "ProviderDisplayName", + table: "AspNetUserLogins", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ProviderKey", + table: "AspNetUserLogins", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "LoginProvider", + table: "AspNetUserLogins", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "UserId", + table: "AspNetUserClaims", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "AspNetUserClaims", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "AspNetUserClaims", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "NormalizedName", + table: "AspNetRoles", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Name", + table: "AspNetRoles", + type: "varchar(256) CHARACTER SET utf8mb4", + maxLength: 256, + nullable: true, + oldClrType: typeof(string), + oldMaxLength: 256, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ConcurrencyStamp", + table: "AspNetRoles", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Id", + table: "AspNetRoles", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "RoleId", + table: "AspNetRoleClaims", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: false, + oldClrType: typeof(string)); + + migrationBuilder.AlterColumn( + name: "ClaimValue", + table: "AspNetRoleClaims", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ClaimType", + table: "AspNetRoleClaims", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Title", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedUserId", + table: "AlbumRequests", + type: "varchar(255) CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "RequestedByAlias", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ForeignArtistId", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ForeignAlbumId", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Disk", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "DeniedReason", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Cover", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "ArtistName", + table: "AlbumRequests", + type: "longtext CHARACTER SET utf8mb4", + nullable: true, + oldClrType: typeof(string), + oldNullable: true); + + + migrationBuilder.Sql("SET FOREIGN_KEY_CHECKS=1;"); + } + } +} diff --git a/src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs b/src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs index e47a5f12b..1678a77c1 100644 --- a/src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs +++ b/src/Ombi.Store/Migrations/OmbiMySql/OmbiMySqlContextModelSnapshot.cs @@ -20,18 +20,18 @@ namespace Ombi.Store.Migrations.OmbiMySql modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b => { b.Property("Id") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Name") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.Property("NormalizedName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.HasKey("Id"); @@ -50,14 +50,14 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("ClaimType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ClaimValue") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RoleId") .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -73,14 +73,14 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("ClaimType") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ClaimValue") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserId") .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -92,17 +92,17 @@ namespace Ombi.Store.Migrations.OmbiMySql modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ProviderKey") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("ProviderDisplayName") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserId") .IsRequired() - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("LoginProvider", "ProviderKey"); @@ -114,10 +114,10 @@ namespace Ombi.Store.Migrations.OmbiMySql modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("RoleId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("UserId", "RoleId"); @@ -129,16 +129,16 @@ namespace Ombi.Store.Migrations.OmbiMySql modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("LoginProvider") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("Name") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("Value") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("UserId", "LoginProvider", "Name"); @@ -161,10 +161,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("Description") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("User") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -181,10 +181,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("Token") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -206,13 +206,13 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("tinyint(1)"); b.Property("Message") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("NotificationType") .HasColumnType("int"); b.Property("Subject") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -229,10 +229,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("PlayerId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -244,20 +244,20 @@ namespace Ombi.Store.Migrations.OmbiMySql modelBuilder.Entity("Ombi.Store.Entities.OmbiUser", b => { b.Property("Id") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("AccessFailedCount") .HasColumnType("int"); b.Property("Alias") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Email") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.Property("EmailConfirmed") @@ -267,7 +267,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Language") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("LastLoggedIn") .HasColumnType("datetime(6)"); @@ -285,36 +285,36 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("NormalizedEmail") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.Property("NormalizedUserName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.Property("PasswordHash") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("PhoneNumber") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("PhoneNumberConfirmed") .HasColumnType("tinyint(1)"); b.Property("ProviderUserId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("SecurityStamp") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TwoFactorEnabled") .HasColumnType("tinyint(1)"); b.Property("UserAccessToken") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserName") - .HasColumnType("varchar(256) CHARACTER SET utf8mb4") + .HasColumnType("varchar(256)") .HasMaxLength(256); b.Property("UserType") @@ -342,7 +342,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("AlbumId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ContentId") .HasColumnType("int"); @@ -377,7 +377,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("Error") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestId") .HasColumnType("int"); @@ -406,7 +406,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -425,28 +425,28 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("tinyint(1)"); b.Property("ArtistName") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Available") .HasColumnType("tinyint(1)"); b.Property("Cover") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Denied") .HasColumnType("tinyint(1)"); b.Property("DeniedReason") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Disk") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ForeignAlbumId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ForeignArtistId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("MarkedAsApproved") .HasColumnType("datetime(6)"); @@ -467,16 +467,16 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("RequestedByAlias") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestedDate") .HasColumnType("datetime(6)"); b.Property("RequestedUserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -501,7 +501,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("tinyint(1)"); b.Property("DeniedReason") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("IssueId") .HasColumnType("int"); @@ -522,19 +522,19 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("RequestedByAlias") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestedDate") .HasColumnType("datetime(6)"); b.Property("RequestedUserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("SeriesType") .HasColumnType("int"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -552,7 +552,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Value") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -566,7 +566,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Comment") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Date") .HasColumnType("datetime(6)"); @@ -575,7 +575,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -596,7 +596,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("Description") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("IssueCategoryId") .HasColumnType("int"); @@ -605,7 +605,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("ProviderId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestId") .HasColumnType("int"); @@ -620,13 +620,13 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Subject") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserReportedId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -652,25 +652,25 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("tinyint(1)"); b.Property("Background") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Denied") .HasColumnType("tinyint(1)"); b.Property("DeniedReason") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("DigitalReleaseDate") .HasColumnType("datetime(6)"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("IssueId") .HasColumnType("int"); b.Property("LangCode") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("MarkedAsApproved") .HasColumnType("datetime(6)"); @@ -682,10 +682,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("datetime(6)"); b.Property("Overview") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("PosterPath") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("QualityOverride") .HasColumnType("int"); @@ -697,25 +697,25 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("RequestedByAlias") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("RequestedDate") .HasColumnType("datetime(6)"); b.Property("RequestedUserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("RootPathOverride") .HasColumnType("int"); b.Property("Status") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TheMovieDbId") .HasColumnType("int"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -743,7 +743,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -759,16 +759,16 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Background") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("ImdbId") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Overview") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("PosterPath") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("QualityOverride") .HasColumnType("int"); @@ -780,10 +780,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Status") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("TotalSeasons") .HasColumnType("int"); @@ -803,10 +803,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Token") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -828,10 +828,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("tinyint(1)"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("Value") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); @@ -865,7 +865,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.HasKey("Id"); @@ -893,7 +893,7 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("UserId") - .HasColumnType("varchar(255) CHARACTER SET utf8mb4"); + .HasColumnType("varchar(255)"); b.Property("VoteType") .HasColumnType("int"); @@ -930,10 +930,10 @@ namespace Ombi.Store.Migrations.OmbiMySql .HasColumnType("int"); b.Property("Title") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.Property("Url") - .HasColumnType("longtext CHARACTER SET utf8mb4"); + .HasColumnType("longtext"); b.HasKey("Id"); diff --git a/src/Ombi/Extensions/DatabaseExtensions.cs b/src/Ombi/Extensions/DatabaseExtensions.cs index 21680f8b9..979f1688b 100644 --- a/src/Ombi/Extensions/DatabaseExtensions.cs +++ b/src/Ombi/Extensions/DatabaseExtensions.cs @@ -120,7 +120,10 @@ namespace Ombi.Extensions public static void ConfigureMySql(DbContextOptionsBuilder options, PerDatabaseConfiguration config) { - options.UseMySql(config.ConnectionString); + options.UseMySql(config.ConnectionString, b => + { + b.CharSetBehavior(Pomelo.EntityFrameworkCore.MySql.Infrastructure.CharSetBehavior.NeverAppend); + }); } public class DatabaseConfiguration