From 95ef1b605918200ace7735d1510d87401c10c277 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Thu, 18 Oct 2018 17:45:55 -0500 Subject: [PATCH] convert unsigned to signed keys in data layer closes #593 --- ...018170013_UseSignedPrimaryKeys.Designer.cs | 684 ++++++++++++++++++ .../20181018170013_UseSignedPrimaryKeys.cs | 601 +++++++++++++++ .../Extensions/MigrationBuilderExtensions.cs | 340 +++++++++ .../FilterListsDbContextModelSnapshot.cs | 76 +- src/FilterLists.Data/Entities/BaseEntity.cs | 2 +- src/FilterLists.Data/Entities/FilterList.cs | 4 +- .../Entities/Junctions/Dependent.cs | 4 +- .../Entities/Junctions/FilterListLanguage.cs | 4 +- .../Junctions/FilterListMaintainer.cs | 4 +- .../Entities/Junctions/FilterListTag.cs | 4 +- .../Entities/Junctions/Fork.cs | 4 +- .../Entities/Junctions/Merge.cs | 4 +- .../Entities/Junctions/SnapshotRule.cs | 4 +- .../Entities/Junctions/SoftwareSyntax.cs | 4 +- src/FilterLists.Data/Entities/Snapshot.cs | 2 +- .../BaseEntityTypeConfiguration.cs | 2 +- .../FilterListTypeConfiguration.cs | 2 +- .../LicenseTypeConfiguration.cs | 2 - .../RuleTypeConfiguration.cs | 2 +- .../SnapshotTypeConfiguration.cs | 2 +- .../SoftwareTypeConfiguration.cs | 2 - .../SyntaxTypeConfiguration.cs | 2 - .../TagTypeConfiguration.cs | 2 - .../FilterListDtoMappingProfile.cs | 12 +- .../LanguageDtoMappingProfile.cs | 4 +- .../LicenseDtoMappingProfile.cs | 4 +- .../MaintainerDtoMappingProfile.cs | 4 +- .../Seed/Models/FilterListSeedDto.cs | 6 +- .../Seed/Models/Junctions/DependentSeedDto.cs | 4 +- .../Junctions/FilterListLanguageSeedDto.cs | 4 +- .../Junctions/FilterListMaintainerSeedDto.cs | 4 +- .../Models/Junctions/FilterListTagSeedDto.cs | 4 +- .../Seed/Models/Junctions/ForkSeedDto.cs | 4 +- .../Seed/Models/Junctions/MergeSeedDto.cs | 4 +- .../Models/Junctions/SoftwareSyntaxSeedDto.cs | 4 +- .../Seed/Models/LanguageSeedDto.cs | 2 +- .../Seed/Models/LicenseSeedDto.cs | 2 +- .../Seed/Models/MaintainerSeedDto.cs | 2 +- .../Seed/Models/SoftwareSeedDto.cs | 2 +- .../Seed/Models/SyntaxSeedDto.cs | 2 +- .../Seed/Models/TagSeedDto.cs | 2 +- .../SoftwareDtoMappingProfile.cs | 4 +- .../SyntaxDtoMappingProfile.cs | 6 +- .../MappingProfiles/TagDtoMappingProfile.cs | 4 +- 44 files changed, 1729 insertions(+), 112 deletions(-) create mode 100644 src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.Designer.cs create mode 100644 src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.cs diff --git a/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.Designer.cs b/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.Designer.cs new file mode 100644 index 000000000..1e6ebe114 --- /dev/null +++ b/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.Designer.cs @@ -0,0 +1,684 @@ +// + +using System; +using FilterLists.Data; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace FilterLists.Api.Migrations +{ + [DbContext(typeof(FilterListsDbContext))] + [Migration("20181018170013_UseSignedPrimaryKeys")] + partial class UseSignedPrimaryKeys + { + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "2.1.4-rtm-31024") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("ChatUrl") + .HasColumnType("TEXT"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("DescriptionSourceUrl") + .HasColumnType("TEXT"); + + b.Property("DonateUrl") + .HasColumnType("TEXT"); + + b.Property("EmailAddress") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(126)") + .HasDefaultValueSql("NULL"); + + b.Property("ForumUrl") + .HasColumnType("TEXT"); + + b.Property("HomeUrl") + .HasColumnType("TEXT"); + + b.Property("IssuesUrl") + .HasColumnType("TEXT"); + + b.Property("LicenseId") + .ValueGeneratedOnAdd() + .HasDefaultValue((short)5); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.Property("PolicyUrl") + .HasColumnType("TEXT"); + + b.Property("PublishedDate") + .ValueGeneratedOnAdd() + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); + + b.Property("SubmissionUrl") + .HasColumnType("TEXT"); + + b.Property("SyntaxId"); + + b.Property("UpdatedDate") + .ValueGeneratedOnAdd() + .HasColumnType("DATETIME") + .HasDefaultValueSql("NULL"); + + b.Property("ViewUrl") + .HasColumnType("TEXT"); + + b.Property("ViewUrlMirror1") + .HasColumnType("TEXT"); + + b.Property("ViewUrlMirror2") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("LicenseId"); + + b.HasIndex("SyntaxId"); + + b.ToTable("filterlists"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Dependent", b => + { + b.Property("DependentFilterListId"); + + b.Property("DependencyFilterListId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("DependentFilterListId", "DependencyFilterListId"); + + b.HasIndex("DependencyFilterListId"); + + b.ToTable("dependents"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b => + { + b.Property("FilterListId"); + + b.Property("LanguageId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("FilterListId", "LanguageId"); + + b.HasIndex("LanguageId"); + + b.ToTable("filterlists_languages"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b => + { + b.Property("FilterListId"); + + b.Property("MaintainerId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("FilterListId", "MaintainerId"); + + b.HasIndex("MaintainerId"); + + b.ToTable("filterlists_maintainers"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListTag", b => + { + b.Property("FilterListId"); + + b.Property("TagId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("FilterListId", "TagId"); + + b.HasIndex("TagId"); + + b.ToTable("filterlists_tags"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b => + { + b.Property("ForkFilterListId"); + + b.Property("UpstreamFilterListId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("ForkFilterListId", "UpstreamFilterListId"); + + b.HasIndex("UpstreamFilterListId"); + + b.ToTable("forks"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b => + { + b.Property("MergeFilterListId"); + + b.Property("UpstreamFilterListId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("MergeFilterListId", "UpstreamFilterListId"); + + b.HasIndex("UpstreamFilterListId"); + + b.ToTable("merges"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SnapshotRule", b => + { + b.Property("SnapshotId"); + + b.Property("RuleId"); + + b.HasKey("SnapshotId", "RuleId"); + + b.HasIndex("RuleId"); + + b.ToTable("snapshots_rules"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b => + { + b.Property("SyntaxId"); + + b.Property("SoftwareId"); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.HasKey("SyntaxId", "SoftwareId"); + + b.HasIndex("SoftwareId"); + + b.ToTable("software_syntaxes"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Language", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("Iso6391") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(2)") + .HasDefaultValueSql("NULL"); + + b.Property("Iso6392") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(3)") + .HasDefaultValueSql("NULL"); + + b.Property("Iso6392B") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(3)") + .HasDefaultValueSql("NULL"); + + b.Property("Iso6392T") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(3)") + .HasDefaultValueSql("NULL"); + + b.Property("Iso6393") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(3)") + .HasDefaultValueSql("NULL"); + + b.Property("LocalName") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(126)") + .HasDefaultValueSql("NULL"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(126)") + .HasDefaultValueSql("NULL"); + + b.HasKey("Id"); + + b.ToTable("languages"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.License", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("DescriptionUrl") + .HasColumnType("TEXT"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.Property("PermissiveAdaptation"); + + b.Property("PermissiveCommercial"); + + b.HasKey("Id"); + + b.ToTable("licenses"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("EmailAddress") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(126)") + .HasDefaultValueSql("NULL"); + + b.Property("HomeUrl") + .HasColumnType("TEXT"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.Property("TwitterHandle") + .ValueGeneratedOnAdd() + .HasColumnType("VARCHAR(126)") + .HasDefaultValueSql("NULL"); + + b.HasKey("Id"); + + b.ToTable("maintainers"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Rule", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("Raw") + .IsRequired() + .HasColumnType("LONGTEXT"); + + b.HasKey("Id"); + + b.ToTable("rules"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("MEDIUMINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("FilterListId"); + + b.Property("HttpStatusCode") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasDefaultValueSql("NULL"); + + b.Property("Md5Checksum") + .HasColumnType("BINARY(16)"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("WasSuccessful"); + + b.Property("WasUpdated"); + + b.Property("WaybackTimestamp") + .HasColumnType("TIMESTAMP"); + + b.Property("WaybackUrl") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("FilterListId"); + + b.ToTable("snapshots"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Software", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("DownloadUrl") + .HasColumnType("TEXT"); + + b.Property("HomeUrl") + .HasColumnType("TEXT"); + + b.Property("IsAbpSubscribable"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.HasKey("Id"); + + b.ToTable("software"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("DefinitionUrl") + .HasColumnType("TEXT"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.HasKey("Id"); + + b.ToTable("syntaxes"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Tag", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("SMALLINT") + .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); + + b.Property("CreatedDateUtc") + .IsRequired() + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp()"); + + b.Property("Description") + .HasColumnType("TEXT"); + + b.Property("ModifiedDateUtc") + .IsRequired() + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP") + .HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()"); + + b.Property("Name") + .IsRequired() + .HasColumnType("VARCHAR(126)"); + + b.HasKey("Id"); + + b.ToTable("tags"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => + { + b.HasOne("FilterLists.Data.Entities.License", "License") + .WithMany("FilterLists") + .HasForeignKey("LicenseId"); + + b.HasOne("FilterLists.Data.Entities.Syntax", "Syntax") + .WithMany("FilterLists") + .HasForeignKey("SyntaxId"); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Dependent", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "DependencyFilterList") + .WithMany("DependencyFilterLists") + .HasForeignKey("DependencyFilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.FilterList", "DependentFilterList") + .WithMany("DependentFilterLists") + .HasForeignKey("DependentFilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListLanguages") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.Language", "Language") + .WithMany("FilterListLanguages") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListMaintainers") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.Maintainer", "Maintainer") + .WithMany("FilterListMaintainers") + .HasForeignKey("MaintainerId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListTag", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListTags") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.Tag", "Tag") + .WithMany("FilterListTags") + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "ForkFilterList") + .WithMany("ForkFilterLists") + .HasForeignKey("ForkFilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") + .WithMany("UpstreamForkFilterLists") + .HasForeignKey("UpstreamFilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "MergeFilterList") + .WithMany("MergeFilterLists") + .HasForeignKey("MergeFilterListId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") + .WithMany("UpstreamMergeFilterLists") + .HasForeignKey("UpstreamFilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SnapshotRule", b => + { + b.HasOne("FilterLists.Data.Entities.Rule", "Rule") + .WithMany("SnapshotRules") + .HasForeignKey("RuleId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.Snapshot", "Snapshot") + .WithMany("SnapshotRules") + .HasForeignKey("SnapshotId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b => + { + b.HasOne("FilterLists.Data.Entities.Software", "Software") + .WithMany("SoftwareSyntaxes") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("FilterLists.Data.Entities.Syntax", "Syntax") + .WithMany("SoftwareSyntaxes") + .HasForeignKey("SyntaxId") + .OnDelete(DeleteBehavior.Cascade); + }); + + modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b => + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("Snapshots") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); +#pragma warning restore 612, 618 + } + } +} \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.cs b/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.cs new file mode 100644 index 000000000..7f083fcba --- /dev/null +++ b/src/FilterLists.Api/Migrations/20181018170013_UseSignedPrimaryKeys.cs @@ -0,0 +1,601 @@ +using FilterLists.Api.Migrations.Extensions; +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace FilterLists.Api.Migrations +{ + public partial class UseSignedPrimaryKeys : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropFK_filterlists_tags_tags_TagId(); + + migrationBuilder.AlterColumn( + "Id", + "tags", + "SMALLINT", + nullable: false, + oldClrType: typeof(byte), + oldType: "TINYINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "TagId", + "filterlists_tags", + nullable: false, + oldClrType: typeof(byte)); + + migrationBuilder.AddFK_filterlists_tags_tags_TagId(); + + migrationBuilder.DropFK_filterlists_syntaxes_SyntaxId(); + + migrationBuilder.DropFK_software_syntaxes_syntaxes_SyntaxId(); + + migrationBuilder.AlterColumn( + "Id", + "syntaxes", + "SMALLINT", + nullable: false, + oldClrType: typeof(byte), + oldType: "TINYINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "SyntaxId", + "filterlists", + nullable: true, + oldClrType: typeof(byte), + oldNullable: true); + + migrationBuilder.AddFK_filterlists_syntaxes_SyntaxId(); + + migrationBuilder.AlterColumn( + "SyntaxId", + "software_syntaxes", + nullable: false, + oldClrType: typeof(byte)); + + migrationBuilder.AddFK_software_syntaxes_syntaxes_SyntaxId(); + + migrationBuilder.DropFK_software_syntaxes_software_SoftwareId(); + + migrationBuilder.AlterColumn( + "SoftwareId", + "software_syntaxes", + nullable: false, + oldClrType: typeof(byte)); + + migrationBuilder.AlterColumn( + "Id", + "software", + "SMALLINT", + nullable: false, + oldClrType: typeof(byte), + oldType: "TINYINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_software_syntaxes_software_SoftwareId(); + + migrationBuilder.DropFK_snapshots_rules_rules_RuleId(); + + migrationBuilder.AlterColumn( + "RuleId", + "snapshots_rules", + nullable: false, + oldClrType: typeof(uint)); + + migrationBuilder.AlterColumn( + "Id", + "rules", + "INT", + nullable: false, + oldClrType: typeof(uint), + oldType: "INT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_rules_rules_RuleId(); + + migrationBuilder.DropFK_snapshots_rules_snapshots_SnapshotId(); + + migrationBuilder.AlterColumn( + "SnapshotId", + "snapshots_rules", + nullable: false, + oldClrType: typeof(uint)); + + migrationBuilder.AlterColumn( + "Id", + "snapshots", + "MEDIUMINT", + nullable: false, + oldClrType: typeof(uint), + oldType: "MEDIUMINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_rules_snapshots_SnapshotId(); + + migrationBuilder.DropFK_snapshots_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "snapshots", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_merges_filterlists_UpstreamFilterListId(); + + migrationBuilder.AlterColumn( + "UpstreamFilterListId", + "merges", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_merges_filterlists_MergeFilterListId(); + + migrationBuilder.AlterColumn( + "MergeFilterListId", + "merges", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_forks_filterlists_UpstreamFilterListId(); + + migrationBuilder.AlterColumn( + "UpstreamFilterListId", + "forks", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_forks_filterlists_ForkFilterListId(); + + migrationBuilder.AlterColumn( + "ForkFilterListId", + "forks", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_filterlists_tags_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_tags", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_filterlists_maintainers_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_maintainers", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_filterlists_languages_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_languages", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.DropFK_dependents_filterlists_DependencyFilterListId(); + + migrationBuilder.DropFK_dependents_filterlists_DependentFilterListId(); + + migrationBuilder.AlterColumn( + "Id", + "filterlists", + "SMALLINT", + nullable: false, + oldClrType: typeof(ushort), + oldType: "SMALLINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_filterlists_FilterListId(); + + migrationBuilder.AddFK_merges_filterlists_UpstreamFilterListId(); + + migrationBuilder.AddFK_merges_filterlists_MergeFilterListId(); + + migrationBuilder.AddFK_forks_filterlists_UpstreamFilterListId(); + + migrationBuilder.AddFK_forks_filterlists_ForkFilterListId(); + + migrationBuilder.AddFK_filterlists_tags_filterlists_FilterListId(); + + migrationBuilder.AddFK_filterlists_maintainers_filterlists_FilterListId(); + + migrationBuilder.AddFK_filterlists_languages_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "DependencyFilterListId", + "dependents", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.AddFK_dependents_filterlists_DependencyFilterListId(); + + migrationBuilder.AlterColumn( + "DependentFilterListId", + "dependents", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.AddFK_dependents_filterlists_DependentFilterListId(); + + migrationBuilder.DropFK_filterlists_maintainers_maintainers_MaintainerId(); + + migrationBuilder.AlterColumn( + "Id", + "maintainers", + "SMALLINT", + nullable: false, + oldClrType: typeof(ushort), + oldType: "SMALLINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "MaintainerId", + "filterlists_maintainers", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.AddFK_filterlists_maintainers_maintainers_MaintainerId(); + + migrationBuilder.DropFK_filterlists_licenses_LicenseId(); + + migrationBuilder.AlterColumn( + "Id", + "licenses", + "SMALLINT", + nullable: false, + oldClrType: typeof(byte), + oldType: "TINYINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "LicenseId", + "filterlists", + nullable: true, + defaultValue: (short)5, + oldClrType: typeof(byte), + oldNullable: true, + oldDefaultValue: (byte)5); + + migrationBuilder.AddFK_filterlists_licenses_LicenseId(); + + migrationBuilder.DropFK_filterlists_languages_languages_LanguageId(); + + migrationBuilder.AlterColumn( + "Id", + "languages", + "SMALLINT", + nullable: false, + oldClrType: typeof(ushort), + oldType: "SMALLINT UNSIGNED") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "LanguageId", + "filterlists_languages", + nullable: false, + oldClrType: typeof(ushort)); + + migrationBuilder.AddFK_filterlists_languages_languages_LanguageId(); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropFK_filterlists_tags_tags_TagId(); + + migrationBuilder.AlterColumn( + "Id", + "tags", + "TINYINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "TagId", + "filterlists_tags", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_filterlists_tags_tags_TagId(); + + migrationBuilder.DropFK_filterlists_syntaxes_SyntaxId(); + + migrationBuilder.DropFK_software_syntaxes_syntaxes_SyntaxId(); + + migrationBuilder.AlterColumn( + "Id", + "syntaxes", + "TINYINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "SyntaxId", + "filterlists", + nullable: true, + oldClrType: typeof(short), + oldNullable: true); + + migrationBuilder.AddFK_filterlists_syntaxes_SyntaxId(); + + migrationBuilder.AlterColumn( + "SyntaxId", + "software_syntaxes", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_software_syntaxes_syntaxes_SyntaxId(); + + migrationBuilder.DropFK_software_syntaxes_software_SoftwareId(); + + migrationBuilder.AlterColumn( + "SoftwareId", + "software_syntaxes", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AlterColumn( + "Id", + "software", + "TINYINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_software_syntaxes_software_SoftwareId(); + + migrationBuilder.DropFK_snapshots_rules_rules_RuleId(); + + migrationBuilder.AlterColumn( + "RuleId", + "snapshots_rules", + nullable: false, + oldClrType: typeof(int)); + + migrationBuilder.AlterColumn( + "Id", + "rules", + "INT UNSIGNED", + nullable: false, + oldClrType: typeof(int), + oldType: "INT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_rules_rules_RuleId(); + + migrationBuilder.DropFK_snapshots_rules_snapshots_SnapshotId(); + + migrationBuilder.AlterColumn( + "SnapshotId", + "snapshots_rules", + nullable: false, + oldClrType: typeof(int)); + + migrationBuilder.AlterColumn( + "Id", + "snapshots", + "MEDIUMINT UNSIGNED", + nullable: false, + oldClrType: typeof(int), + oldType: "MEDIUMINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_rules_snapshots_SnapshotId(); + + migrationBuilder.DropFK_snapshots_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "snapshots", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_merges_filterlists_UpstreamFilterListId(); + + migrationBuilder.AlterColumn( + "UpstreamFilterListId", + "merges", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_merges_filterlists_MergeFilterListId(); + + migrationBuilder.AlterColumn( + "MergeFilterListId", + "merges", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_forks_filterlists_UpstreamFilterListId(); + + migrationBuilder.AlterColumn( + "UpstreamFilterListId", + "forks", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_forks_filterlists_ForkFilterListId(); + + migrationBuilder.AlterColumn( + "ForkFilterListId", + "forks", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_filterlists_tags_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_tags", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_filterlists_maintainers_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_maintainers", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_filterlists_languages_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "FilterListId", + "filterlists_languages", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.DropFK_dependents_filterlists_DependencyFilterListId(); + + migrationBuilder.DropFK_dependents_filterlists_DependentFilterListId(); + + migrationBuilder.AlterColumn( + "Id", + "filterlists", + "SMALLINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AddFK_snapshots_filterlists_FilterListId(); + + migrationBuilder.AddFK_merges_filterlists_UpstreamFilterListId(); + + migrationBuilder.AddFK_merges_filterlists_MergeFilterListId(); + + migrationBuilder.AddFK_forks_filterlists_UpstreamFilterListId(); + + migrationBuilder.AddFK_forks_filterlists_ForkFilterListId(); + + migrationBuilder.AddFK_filterlists_tags_filterlists_FilterListId(); + + migrationBuilder.AddFK_filterlists_maintainers_filterlists_FilterListId(); + + migrationBuilder.AddFK_filterlists_languages_filterlists_FilterListId(); + + migrationBuilder.AlterColumn( + "DependencyFilterListId", + "dependents", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_dependents_filterlists_DependencyFilterListId(); + + migrationBuilder.AlterColumn( + "DependentFilterListId", + "dependents", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_dependents_filterlists_DependentFilterListId(); + + migrationBuilder.DropFK_filterlists_maintainers_maintainers_MaintainerId(); + + migrationBuilder.AlterColumn( + "Id", + "maintainers", + "SMALLINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "MaintainerId", + "filterlists_maintainers", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_filterlists_maintainers_maintainers_MaintainerId(); + + migrationBuilder.DropFK_filterlists_licenses_LicenseId(); + + migrationBuilder.AlterColumn( + "Id", + "licenses", + "TINYINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "LicenseId", + "filterlists", + nullable: true, + defaultValue: (byte)5, + oldClrType: typeof(short), + oldNullable: true, + oldDefaultValue: (short)5); + + migrationBuilder.AddFK_filterlists_licenses_LicenseId(); + + migrationBuilder.DropFK_filterlists_languages_languages_LanguageId(); + + migrationBuilder.AlterColumn( + "Id", + "languages", + "SMALLINT UNSIGNED", + nullable: false, + oldClrType: typeof(short), + oldType: "SMALLINT") + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) + .OldAnnotation("MySql:ValueGenerationStrategy", + MySqlValueGenerationStrategy.IdentityColumn); + + migrationBuilder.AlterColumn( + "LanguageId", + "filterlists_languages", + nullable: false, + oldClrType: typeof(short)); + + migrationBuilder.AddFK_filterlists_languages_languages_LanguageId(); + } + } +} \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/Extensions/MigrationBuilderExtensions.cs b/src/FilterLists.Api/Migrations/Extensions/MigrationBuilderExtensions.cs index 4fc37aac9..62197ebf0 100644 --- a/src/FilterLists.Api/Migrations/Extensions/MigrationBuilderExtensions.cs +++ b/src/FilterLists.Api/Migrations/Extensions/MigrationBuilderExtensions.cs @@ -21,5 +21,345 @@ public static OperationBuilder DropIndex(this MigrationBuilder mig throw new NotImplementedException(); //return migrationBuilder.Sql($"CREATE INDEX index_name ON misc_info (key(10));"); } + + public static void DropFK_filterlists_tags_tags_TagId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_tags_tags_TagId", + "filterlists_tags"); + } + + public static void AddFK_filterlists_tags_tags_TagId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_tags_tags_TagId", + "filterlists_tags", + "TagId", + "tags", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_syntaxes_SyntaxId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_syntaxes_SyntaxId", + "filterlists"); + } + + public static void AddFK_filterlists_syntaxes_SyntaxId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_syntaxes_SyntaxId", + "filterlists", + "SyntaxId", + "syntaxes", + principalColumn: "Id"); + } + + public static void DropFK_software_syntaxes_syntaxes_SyntaxId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_software_syntaxes_syntaxes_SyntaxId", + "software_syntaxes"); + } + + public static void AddFK_software_syntaxes_syntaxes_SyntaxId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_software_syntaxes_syntaxes_SyntaxId", + "software_syntaxes", + "SyntaxId", + "syntaxes", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_software_syntaxes_software_SoftwareId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_software_syntaxes_software_SoftwareId", + "software_syntaxes"); + } + + public static void AddFK_software_syntaxes_software_SoftwareId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_software_syntaxes_software_SoftwareId", + "software_syntaxes", + "SoftwareId", + "software", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_snapshots_rules_rules_RuleId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_snapshots_rules_rules_RuleId", + "snapshots_rules"); + } + + public static void AddFK_snapshots_rules_rules_RuleId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_snapshots_rules_rules_RuleId", + "snapshots_rules", + "RuleId", + "rules", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_snapshots_rules_snapshots_SnapshotId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_snapshots_rules_snapshots_SnapshotId", + "snapshots_rules"); + } + + public static void AddFK_snapshots_rules_snapshots_SnapshotId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_snapshots_rules_snapshots_SnapshotId", + "snapshots_rules", + "SnapshotId", + "snapshots", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_snapshots_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_snapshots_filterlists_FilterListId", + "snapshots"); + } + + public static void AddFK_snapshots_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_snapshots_filterlists_FilterListId", + "snapshots", + "FilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_merges_filterlists_UpstreamFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_merges_filterlists_UpstreamFilterListId", + "merges"); + } + + public static void AddFK_merges_filterlists_UpstreamFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_merges_filterlists_UpstreamFilterListId", + "merges", + "UpstreamFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_merges_filterlists_MergeFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_merges_filterlists_MergeFilterListId", + "merges"); + } + + public static void AddFK_merges_filterlists_MergeFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_merges_filterlists_MergeFilterListId", + "merges", + "MergeFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_forks_filterlists_UpstreamFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_forks_filterlists_UpstreamFilterListId", + "forks"); + } + + public static void AddFK_forks_filterlists_UpstreamFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_forks_filterlists_UpstreamFilterListId", + "forks", + "UpstreamFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_forks_filterlists_ForkFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_forks_filterlists_ForkFilterListId", + "forks"); + } + + public static void AddFK_forks_filterlists_ForkFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_forks_filterlists_ForkFilterListId", + "forks", + "ForkFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_tags_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_tags_filterlists_FilterListId", + "filterlists_tags"); + } + + public static void AddFK_filterlists_tags_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_tags_filterlists_FilterListId", + "filterlists_tags", + "FilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_maintainers_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_maintainers_filterlists_FilterListId", + "filterlists_maintainers"); + } + + public static void AddFK_filterlists_maintainers_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_maintainers_filterlists_FilterListId", + "filterlists_maintainers", + "FilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_languages_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_languages_filterlists_FilterListId", + "filterlists_languages"); + } + + public static void AddFK_filterlists_languages_filterlists_FilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_languages_filterlists_FilterListId", + "filterlists_languages", + "FilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_dependents_filterlists_DependencyFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_dependents_filterlists_DependencyFilterListId", + "dependents"); + } + + public static void AddFK_dependents_filterlists_DependencyFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_dependents_filterlists_DependencyFilterListId", + "dependents", + "DependencyFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_dependents_filterlists_DependentFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_dependents_filterlists_DependentFilterListId", + "dependents"); + } + + public static void AddFK_dependents_filterlists_DependentFilterListId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_dependents_filterlists_DependentFilterListId", + "dependents", + "DependentFilterListId", + "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_maintainers_maintainers_MaintainerId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_maintainers_maintainers_MaintainerId", + "filterlists_maintainers"); + } + + public static void AddFK_filterlists_maintainers_maintainers_MaintainerId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_maintainers_maintainers_MaintainerId", + "filterlists_maintainers", + "MaintainerId", + "maintainers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + public static void DropFK_filterlists_licenses_LicenseId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_licenses_LicenseId", + "filterlists"); + } + + public static void AddFK_filterlists_licenses_LicenseId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_licenses_LicenseId", + "filterlists", + "LicenseId", + "licenses", + principalColumn: "Id"); + } + + public static void DropFK_filterlists_languages_languages_LanguageId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + "FK_filterlists_languages_languages_LanguageId", + "filterlists_languages"); + } + + public static void AddFK_filterlists_languages_languages_LanguageId(this MigrationBuilder migrationBuilder) + { + migrationBuilder.AddForeignKey( + "FK_filterlists_languages_languages_LanguageId", + "filterlists_languages", + "LanguageId", + "languages", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } } } \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs index 7a7ad27cd..4ea06d109 100644 --- a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs +++ b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs @@ -20,9 +20,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("SMALLINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("ChatUrl") @@ -57,9 +57,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("IssuesUrl") .HasColumnType("TEXT"); - b.Property("LicenseId") + b.Property("LicenseId") .ValueGeneratedOnAdd() - .HasDefaultValue((byte)5); + .HasDefaultValue((short)5); b.Property("ModifiedDateUtc") .IsRequired() @@ -82,7 +82,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("SubmissionUrl") .HasColumnType("TEXT"); - b.Property("SyntaxId"); + b.Property("SyntaxId"); b.Property("UpdatedDate") .ValueGeneratedOnAdd() @@ -109,9 +109,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Dependent", b => { - b.Property("DependentFilterListId"); + b.Property("DependentFilterListId"); - b.Property("DependencyFilterListId"); + b.Property("DependencyFilterListId"); b.Property("CreatedDateUtc") .IsRequired() @@ -128,9 +128,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b => { - b.Property("FilterListId"); + b.Property("FilterListId"); - b.Property("LanguageId"); + b.Property("LanguageId"); b.Property("CreatedDateUtc") .IsRequired() @@ -147,9 +147,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b => { - b.Property("FilterListId"); + b.Property("FilterListId"); - b.Property("MaintainerId"); + b.Property("MaintainerId"); b.Property("CreatedDateUtc") .IsRequired() @@ -166,9 +166,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListTag", b => { - b.Property("FilterListId"); + b.Property("FilterListId"); - b.Property("TagId"); + b.Property("TagId"); b.Property("CreatedDateUtc") .IsRequired() @@ -185,9 +185,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b => { - b.Property("ForkFilterListId"); + b.Property("ForkFilterListId"); - b.Property("UpstreamFilterListId"); + b.Property("UpstreamFilterListId"); b.Property("CreatedDateUtc") .IsRequired() @@ -204,9 +204,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b => { - b.Property("MergeFilterListId"); + b.Property("MergeFilterListId"); - b.Property("UpstreamFilterListId"); + b.Property("UpstreamFilterListId"); b.Property("CreatedDateUtc") .IsRequired() @@ -223,9 +223,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SnapshotRule", b => { - b.Property("SnapshotId"); + b.Property("SnapshotId"); - b.Property("RuleId"); + b.Property("RuleId"); b.HasKey("SnapshotId", "RuleId"); @@ -236,9 +236,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b => { - b.Property("SyntaxId"); + b.Property("SyntaxId"); - b.Property("SoftwareId"); + b.Property("SoftwareId"); b.Property("CreatedDateUtc") .IsRequired() @@ -255,9 +255,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Language", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("SMALLINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -314,9 +314,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.License", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TINYINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -349,9 +349,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("SMALLINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -390,9 +390,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Rule", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("INT UNSIGNED") + .HasColumnType("INT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -412,9 +412,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("MEDIUMINT UNSIGNED") + .HasColumnType("MEDIUMINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -423,7 +423,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP") .HasDefaultValueSql("current_timestamp()"); - b.Property("FilterListId"); + b.Property("FilterListId"); b.Property("HttpStatusCode") .ValueGeneratedOnAdd() @@ -458,9 +458,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Software", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TINYINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -494,9 +494,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TINYINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") @@ -525,9 +525,9 @@ protected override void BuildModel(ModelBuilder modelBuilder) modelBuilder.Entity("FilterLists.Data.Entities.Tag", b => { - b.Property("Id") + b.Property("Id") .ValueGeneratedOnAdd() - .HasColumnType("TINYINT UNSIGNED") + .HasColumnType("SMALLINT") .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn); b.Property("CreatedDateUtc") diff --git a/src/FilterLists.Data/Entities/BaseEntity.cs b/src/FilterLists.Data/Entities/BaseEntity.cs index b97510ac4..d67ea71a5 100644 --- a/src/FilterLists.Data/Entities/BaseEntity.cs +++ b/src/FilterLists.Data/Entities/BaseEntity.cs @@ -4,7 +4,7 @@ namespace FilterLists.Data.Entities { public abstract class BaseEntity : IBaseEntity { - public uint Id { get; set; } + public int Id { get; set; } public DateTime? CreatedDateUtc { get; set; } public DateTime? ModifiedDateUtc { get; set; } } diff --git a/src/FilterLists.Data/Entities/FilterList.cs b/src/FilterLists.Data/Entities/FilterList.cs index e3e5c2d63..bb6146450 100644 --- a/src/FilterLists.Data/Entities/FilterList.cs +++ b/src/FilterLists.Data/Entities/FilterList.cs @@ -21,7 +21,7 @@ public class FilterList : BaseEntity public string HomeUrl { get; set; } public string IssuesUrl { get; set; } public ICollection FilterListLanguages { get; set; } - public uint? LicenseId { get; set; } + public int? LicenseId { get; set; } public License License { get; set; } public ICollection FilterListMaintainers { get; set; } public ICollection MergeFilterLists { get; set; } @@ -31,7 +31,7 @@ public class FilterList : BaseEntity public DateTime? PublishedDate { get; set; } public ICollection Snapshots { get; set; } public string SubmissionUrl { get; set; } - public uint? SyntaxId { get; set; } + public int? SyntaxId { get; set; } public Syntax Syntax { get; set; } public ICollection FilterListTags { get; set; } public DateTime? UpdatedDate { get; set; } diff --git a/src/FilterLists.Data/Entities/Junctions/Dependent.cs b/src/FilterLists.Data/Entities/Junctions/Dependent.cs index b330a27d2..abdffa0cd 100644 --- a/src/FilterLists.Data/Entities/Junctions/Dependent.cs +++ b/src/FilterLists.Data/Entities/Junctions/Dependent.cs @@ -2,9 +2,9 @@ { public class Dependent : BaseJunctionEntity { - public uint DependentFilterListId { get; set; } + public int DependentFilterListId { get; set; } public FilterList DependentFilterList { get; set; } - public uint DependencyFilterListId { get; set; } + public int DependencyFilterListId { get; set; } public FilterList DependencyFilterList { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/FilterListLanguage.cs b/src/FilterLists.Data/Entities/Junctions/FilterListLanguage.cs index bda2a0ff2..dc0f468a3 100644 --- a/src/FilterLists.Data/Entities/Junctions/FilterListLanguage.cs +++ b/src/FilterLists.Data/Entities/Junctions/FilterListLanguage.cs @@ -2,9 +2,9 @@ { public class FilterListLanguage : BaseJunctionEntity { - public uint FilterListId { get; set; } + public int FilterListId { get; set; } public FilterList FilterList { get; set; } - public uint LanguageId { get; set; } + public int LanguageId { get; set; } public Language Language { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/FilterListMaintainer.cs b/src/FilterLists.Data/Entities/Junctions/FilterListMaintainer.cs index 67922e7ac..3801dda01 100644 --- a/src/FilterLists.Data/Entities/Junctions/FilterListMaintainer.cs +++ b/src/FilterLists.Data/Entities/Junctions/FilterListMaintainer.cs @@ -2,9 +2,9 @@ { public class FilterListMaintainer : BaseJunctionEntity { - public uint FilterListId { get; set; } + public int FilterListId { get; set; } public FilterList FilterList { get; set; } - public uint MaintainerId { get; set; } + public int MaintainerId { get; set; } public Maintainer Maintainer { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/FilterListTag.cs b/src/FilterLists.Data/Entities/Junctions/FilterListTag.cs index b1d4915f9..7584afb6c 100644 --- a/src/FilterLists.Data/Entities/Junctions/FilterListTag.cs +++ b/src/FilterLists.Data/Entities/Junctions/FilterListTag.cs @@ -2,9 +2,9 @@ { public class FilterListTag : BaseJunctionEntity { - public uint FilterListId { get; set; } + public int FilterListId { get; set; } public FilterList FilterList { get; set; } - public uint TagId { get; set; } + public int TagId { get; set; } public Tag Tag { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/Fork.cs b/src/FilterLists.Data/Entities/Junctions/Fork.cs index dca5c67ac..704698172 100644 --- a/src/FilterLists.Data/Entities/Junctions/Fork.cs +++ b/src/FilterLists.Data/Entities/Junctions/Fork.cs @@ -2,9 +2,9 @@ { public class Fork : BaseJunctionEntity { - public uint ForkFilterListId { get; set; } + public int ForkFilterListId { get; set; } public FilterList ForkFilterList { get; set; } - public uint UpstreamFilterListId { get; set; } + public int UpstreamFilterListId { get; set; } public FilterList UpstreamFilterList { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/Merge.cs b/src/FilterLists.Data/Entities/Junctions/Merge.cs index 997ea1824..fb6b0a5af 100644 --- a/src/FilterLists.Data/Entities/Junctions/Merge.cs +++ b/src/FilterLists.Data/Entities/Junctions/Merge.cs @@ -2,9 +2,9 @@ { public class Merge : BaseJunctionEntity { - public uint MergeFilterListId { get; set; } + public int MergeFilterListId { get; set; } public FilterList MergeFilterList { get; set; } - public uint UpstreamFilterListId { get; set; } + public int UpstreamFilterListId { get; set; } public FilterList UpstreamFilterList { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/SnapshotRule.cs b/src/FilterLists.Data/Entities/Junctions/SnapshotRule.cs index 088226aa7..73175a2b7 100644 --- a/src/FilterLists.Data/Entities/Junctions/SnapshotRule.cs +++ b/src/FilterLists.Data/Entities/Junctions/SnapshotRule.cs @@ -2,9 +2,9 @@ { public class SnapshotRule : BaseJunctionEntity { - public uint SnapshotId { get; set; } + public int SnapshotId { get; set; } public Snapshot Snapshot { get; set; } - public uint RuleId { get; set; } + public int RuleId { get; set; } public Rule Rule { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Junctions/SoftwareSyntax.cs b/src/FilterLists.Data/Entities/Junctions/SoftwareSyntax.cs index 2520a8b94..617727e3e 100644 --- a/src/FilterLists.Data/Entities/Junctions/SoftwareSyntax.cs +++ b/src/FilterLists.Data/Entities/Junctions/SoftwareSyntax.cs @@ -2,9 +2,9 @@ { public class SoftwareSyntax : BaseJunctionEntity { - public uint SoftwareId { get; set; } + public int SoftwareId { get; set; } public Software Software { get; set; } - public uint SyntaxId { get; set; } + public int SyntaxId { get; set; } public Syntax Syntax { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Data/Entities/Snapshot.cs b/src/FilterLists.Data/Entities/Snapshot.cs index 39131b6c2..c1287d414 100644 --- a/src/FilterLists.Data/Entities/Snapshot.cs +++ b/src/FilterLists.Data/Entities/Snapshot.cs @@ -6,7 +6,7 @@ namespace FilterLists.Data.Entities { public class Snapshot : BaseEntity { - public uint FilterListId { get; set; } + public int FilterListId { get; set; } public FilterList FilterList { get; set; } public int? HttpStatusCode { get; set; } public byte[] Md5Checksum { get; set; } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/BaseEntityTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/BaseEntityTypeConfiguration.cs index 72149cc67..f86f52c30 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/BaseEntityTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/BaseEntityTypeConfiguration.cs @@ -10,7 +10,7 @@ public virtual void Configure(EntityTypeBuilder entityTypeBuilder) { entityTypeBuilder.Property(x => x.Id) .UseMySqlIdentityColumn() - .HasColumnType("SMALLINT UNSIGNED"); + .HasColumnType("SMALLINT"); entityTypeBuilder.Property(x => x.CreatedDateUtc) .HasColumnType("TIMESTAMP") .ValueGeneratedOnAdd() diff --git a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs index e433f517a..f8706e32b 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs @@ -28,7 +28,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.IssuesUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.LicenseId) - .HasDefaultValue((uint)5); + .HasDefaultValue(5); entityTypeBuilder.Property(x => x.Name) .HasColumnType("VARCHAR(126)") .IsRequired(); diff --git a/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs index db4dfb6bf..89d543cf3 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs @@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("licenses"); - entityTypeBuilder.Property(x => x.Id) - .HasColumnType("TINYINT UNSIGNED"); entityTypeBuilder.Property(x => x.DescriptionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) diff --git a/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs index 74a5e24c4..a1dd027c7 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs @@ -11,7 +11,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("rules"); entityTypeBuilder.Property(x => x.Id) - .HasColumnType("INT UNSIGNED"); + .HasColumnType("INT"); entityTypeBuilder.Ignore(x => x.ModifiedDateUtc); entityTypeBuilder.Property(x => x.Raw) .HasColumnType("LONGTEXT") diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SnapshotTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SnapshotTypeConfiguration.cs index 34ae29b27..c82022abc 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/SnapshotTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/SnapshotTypeConfiguration.cs @@ -11,7 +11,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("snapshots"); entityTypeBuilder.Property(x => x.Id) - .HasColumnType("MEDIUMINT UNSIGNED"); + .HasColumnType("MEDIUMINT"); entityTypeBuilder.Property(x => x.HttpStatusCode) .HasColumnType("SMALLINT") .HasDefaultValueSql("NULL"); diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs index ac26fe4e2..0c02e8fce 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs @@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("software"); - entityTypeBuilder.Property(x => x.Id) - .HasColumnType("TINYINT UNSIGNED"); entityTypeBuilder.Property(x => x.DownloadUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.HomeUrl) diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs index 05e91ca52..b1c84c3f0 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs @@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("syntaxes"); - entityTypeBuilder.Property(x => x.Id) - .HasColumnType("TINYINT UNSIGNED"); entityTypeBuilder.Property(x => x.DefinitionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) diff --git a/src/FilterLists.Data/EntityTypeConfigurations/TagTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/TagTypeConfiguration.cs index a37df2f0f..68c921cbf 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/TagTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/TagTypeConfiguration.cs @@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { base.Configure(entityTypeBuilder); entityTypeBuilder.ToTable("tags"); - entityTypeBuilder.Property(x => x.Id) - .HasColumnType("TINYINT UNSIGNED"); entityTypeBuilder.Property(x => x.Name) .HasColumnType("VARCHAR(126)") .IsRequired(); diff --git a/src/FilterLists.Services/FilterList/MappingProfiles/FilterListDtoMappingProfile.cs b/src/FilterLists.Services/FilterList/MappingProfiles/FilterListDtoMappingProfile.cs index 9ce62c5e9..11439e0cc 100644 --- a/src/FilterLists.Services/FilterList/MappingProfiles/FilterListDtoMappingProfile.cs +++ b/src/FilterLists.Services/FilterList/MappingProfiles/FilterListDtoMappingProfile.cs @@ -13,18 +13,18 @@ public FilterListDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.LanguageIds, opt => opt.MapFrom(src => src.FilterListLanguages - .Select(ll => (int)ll.LanguageId))) + .Select(ll => ll.LanguageId))) .ForMember(dest => dest.LicenseId, opt => opt.MapFrom(src => - (int)src.LicenseId)) + src.LicenseId)) .ForMember(dest => dest.MaintainerIds, opt => opt.MapFrom(src => src.FilterListMaintainers - .Select(ll => (int)ll.MaintainerId))) + .Select(ll => ll.MaintainerId))) .ForMember(dest => dest.RuleCount, opt => opt.MapFrom(src => src.Snapshots @@ -33,11 +33,11 @@ public FilterListDtoMappingProfile() => .FirstOrDefault())) .ForMember(dest => dest.SyntaxId, opt => opt.MapFrom(src => - (int)src.SyntaxId)) + src.SyntaxId)) .ForMember(dest => dest.TagIds, opt => opt.MapFrom(src => src.FilterListTags - .Select(lt => (int)lt.TagId))) + .Select(lt => lt.TagId))) .ForMember(dest => dest.ViewUrlMirrors, opt => opt.MapFrom(src => src.ViewUrlMirror1 != null diff --git a/src/FilterLists.Services/Language/MappingProfiles/LanguageDtoMappingProfile.cs b/src/FilterLists.Services/Language/MappingProfiles/LanguageDtoMappingProfile.cs index ff2c38f3a..4076013d6 100644 --- a/src/FilterLists.Services/Language/MappingProfiles/LanguageDtoMappingProfile.cs +++ b/src/FilterLists.Services/Language/MappingProfiles/LanguageDtoMappingProfile.cs @@ -12,10 +12,10 @@ public LanguageDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.FilterListIds, opt => opt.MapFrom(src => src.FilterListLanguages - .Select(fl => (int)fl.FilterListId))); + .Select(fl => fl.FilterListId))); } } \ No newline at end of file diff --git a/src/FilterLists.Services/License/MappingProfiles/LicenseDtoMappingProfile.cs b/src/FilterLists.Services/License/MappingProfiles/LicenseDtoMappingProfile.cs index 9f28e9902..928980498 100644 --- a/src/FilterLists.Services/License/MappingProfiles/LicenseDtoMappingProfile.cs +++ b/src/FilterLists.Services/License/MappingProfiles/LicenseDtoMappingProfile.cs @@ -12,10 +12,10 @@ public LicenseDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.FilterListIds, opt => opt.MapFrom(src => src.FilterLists - .Select(l => (int)l.Id))); + .Select(l => l.Id))); } } \ No newline at end of file diff --git a/src/FilterLists.Services/Maintainer/MappingProfiles/MaintainerDtoMappingProfile.cs b/src/FilterLists.Services/Maintainer/MappingProfiles/MaintainerDtoMappingProfile.cs index 98fca4296..25729fe3c 100644 --- a/src/FilterLists.Services/Maintainer/MappingProfiles/MaintainerDtoMappingProfile.cs +++ b/src/FilterLists.Services/Maintainer/MappingProfiles/MaintainerDtoMappingProfile.cs @@ -12,10 +12,10 @@ public MaintainerDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.FilterListIds, opt => opt.MapFrom(src => src.FilterListMaintainers - .Select(fm => (int)fm.FilterListId))); + .Select(fm => fm.FilterListId))); } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/FilterListSeedDto.cs b/src/FilterLists.Services/Seed/Models/FilterListSeedDto.cs index ed0756a90..f17a08e2d 100644 --- a/src/FilterLists.Services/Seed/Models/FilterListSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/FilterListSeedDto.cs @@ -6,7 +6,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class FilterListSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string ChatUrl { get; set; } public string Description { get; set; } public string DescriptionSourceUrl { get; set; } @@ -15,12 +15,12 @@ public class FilterListSeedDto public string ForumUrl { get; set; } public string HomeUrl { get; set; } public string IssuesUrl { get; set; } - public uint? LicenseId { get; set; } + public int? LicenseId { get; set; } public string Name { get; set; } public string PolicyUrl { get; set; } public DateTime? PublishedDate { get; set; } public string SubmissionUrl { get; set; } - public uint? SyntaxId { get; set; } + public int? SyntaxId { get; set; } public DateTime? UpdatedDate { get; set; } public string ViewUrl { get; set; } public string ViewUrlMirror1 { get; set; } diff --git a/src/FilterLists.Services/Seed/Models/Junctions/DependentSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/DependentSeedDto.cs index 665df8fab..f92a0ff7f 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/DependentSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/DependentSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class DependentSeedDto { - public uint DependentFilterListId { get; set; } - public uint DependencyFilterListId { get; set; } + public int DependentFilterListId { get; set; } + public int DependencyFilterListId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/FilterListLanguageSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/FilterListLanguageSeedDto.cs index 0733e0bad..84c42039e 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/FilterListLanguageSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/FilterListLanguageSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class FilterListLanguageSeedDto { - public uint FilterListId { get; set; } - public uint LanguageId { get; set; } + public int FilterListId { get; set; } + public int LanguageId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/FilterListMaintainerSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/FilterListMaintainerSeedDto.cs index ed682af3d..3dcb8ca39 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/FilterListMaintainerSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/FilterListMaintainerSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class FilterListMaintainerSeedDto { - public uint FilterListId { get; set; } - public uint MaintainerId { get; set; } + public int FilterListId { get; set; } + public int MaintainerId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/FilterListTagSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/FilterListTagSeedDto.cs index d6d9673db..03ac8063a 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/FilterListTagSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/FilterListTagSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class FilterListTagSeedDto { - public uint FilterListId { get; set; } - public uint TagId { get; set; } + public int FilterListId { get; set; } + public int TagId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/ForkSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/ForkSeedDto.cs index ec694e66e..4d723ff99 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/ForkSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/ForkSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class ForkSeedDto { - public uint ForkFilterListId { get; set; } - public uint UpstreamFilterListId { get; set; } + public int ForkFilterListId { get; set; } + public int UpstreamFilterListId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/MergeSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/MergeSeedDto.cs index 5f42a0bd6..f502db398 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/MergeSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/MergeSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class MergeSeedDto { - public uint MergeFilterListId { get; set; } - public uint UpstreamFilterListId { get; set; } + public int MergeFilterListId { get; set; } + public int UpstreamFilterListId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/Junctions/SoftwareSyntaxSeedDto.cs b/src/FilterLists.Services/Seed/Models/Junctions/SoftwareSyntaxSeedDto.cs index 585c02817..585b5cde5 100644 --- a/src/FilterLists.Services/Seed/Models/Junctions/SoftwareSyntaxSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/Junctions/SoftwareSyntaxSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models.Junctions [UsedImplicitly] public class SoftwareSyntaxSeedDto { - public uint SoftwareId { get; set; } - public uint SyntaxId { get; set; } + public int SoftwareId { get; set; } + public int SyntaxId { get; set; } } } \ No newline at end of file diff --git a/src/FilterLists.Services/Seed/Models/LanguageSeedDto.cs b/src/FilterLists.Services/Seed/Models/LanguageSeedDto.cs index 7a4146e09..52b3f9d4b 100644 --- a/src/FilterLists.Services/Seed/Models/LanguageSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/LanguageSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class LanguageSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string Iso6391 { get; set; } public string Iso6392 { get; set; } public string Iso6392B { get; set; } diff --git a/src/FilterLists.Services/Seed/Models/LicenseSeedDto.cs b/src/FilterLists.Services/Seed/Models/LicenseSeedDto.cs index 0af75255a..9d4fb5135 100644 --- a/src/FilterLists.Services/Seed/Models/LicenseSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/LicenseSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class LicenseSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string DescriptionUrl { get; set; } public string Name { get; set; } public bool PermissiveAdaptation { get; set; } diff --git a/src/FilterLists.Services/Seed/Models/MaintainerSeedDto.cs b/src/FilterLists.Services/Seed/Models/MaintainerSeedDto.cs index 6cfb69868..ff864887c 100644 --- a/src/FilterLists.Services/Seed/Models/MaintainerSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/MaintainerSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class MaintainerSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string EmailAddress { get; set; } public string HomeUrl { get; set; } public string Name { get; set; } diff --git a/src/FilterLists.Services/Seed/Models/SoftwareSeedDto.cs b/src/FilterLists.Services/Seed/Models/SoftwareSeedDto.cs index 294a349df..3da2e8df6 100644 --- a/src/FilterLists.Services/Seed/Models/SoftwareSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/SoftwareSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class SoftwareSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string DownloadUrl { get; set; } public string HomeUrl { get; set; } public bool IsAbpSubscribable { get; set; } diff --git a/src/FilterLists.Services/Seed/Models/SyntaxSeedDto.cs b/src/FilterLists.Services/Seed/Models/SyntaxSeedDto.cs index 5609e6224..db9b2d113 100644 --- a/src/FilterLists.Services/Seed/Models/SyntaxSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/SyntaxSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class SyntaxSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string DefinitionUrl { get; set; } public string Name { get; set; } } diff --git a/src/FilterLists.Services/Seed/Models/TagSeedDto.cs b/src/FilterLists.Services/Seed/Models/TagSeedDto.cs index ef74b34b0..53cbb66a0 100644 --- a/src/FilterLists.Services/Seed/Models/TagSeedDto.cs +++ b/src/FilterLists.Services/Seed/Models/TagSeedDto.cs @@ -5,7 +5,7 @@ namespace FilterLists.Services.Seed.Models [UsedImplicitly] public class TagSeedDto { - public uint Id { get; set; } + public int Id { get; set; } public string Description { get; set; } public string Name { get; set; } } diff --git a/src/FilterLists.Services/Software/MappingProfiles/SoftwareDtoMappingProfile.cs b/src/FilterLists.Services/Software/MappingProfiles/SoftwareDtoMappingProfile.cs index f0a8cfb37..70cc35e8f 100644 --- a/src/FilterLists.Services/Software/MappingProfiles/SoftwareDtoMappingProfile.cs +++ b/src/FilterLists.Services/Software/MappingProfiles/SoftwareDtoMappingProfile.cs @@ -12,10 +12,10 @@ public SoftwareDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.SyntaxIds, opt => opt.MapFrom(src => src.SoftwareSyntaxes - .Select(ss => (int)ss.SyntaxId))); + .Select(ss => ss.SyntaxId))); } } \ No newline at end of file diff --git a/src/FilterLists.Services/Syntax/MappingProfiles/SyntaxDtoMappingProfile.cs b/src/FilterLists.Services/Syntax/MappingProfiles/SyntaxDtoMappingProfile.cs index 82eae0e5e..10cb2c2c8 100644 --- a/src/FilterLists.Services/Syntax/MappingProfiles/SyntaxDtoMappingProfile.cs +++ b/src/FilterLists.Services/Syntax/MappingProfiles/SyntaxDtoMappingProfile.cs @@ -12,14 +12,14 @@ public SyntaxDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.FilterListIds, opt => opt.MapFrom(src => src.FilterLists - .Select(l => (int)l.Id))) + .Select(l => l.Id))) .ForMember(dest => dest.SoftwareIds, opt => opt.MapFrom(src => src.SoftwareSyntaxes - .Select(ss => (int)ss.SoftwareId))); + .Select(ss => ss.SoftwareId))); } } \ No newline at end of file diff --git a/src/FilterLists.Services/Tag/MappingProfiles/TagDtoMappingProfile.cs b/src/FilterLists.Services/Tag/MappingProfiles/TagDtoMappingProfile.cs index d1981cc5d..b286385a4 100644 --- a/src/FilterLists.Services/Tag/MappingProfiles/TagDtoMappingProfile.cs +++ b/src/FilterLists.Services/Tag/MappingProfiles/TagDtoMappingProfile.cs @@ -12,10 +12,10 @@ public TagDtoMappingProfile() => CreateMap() .ForMember(dest => dest.Id, opt => opt.MapFrom(src => - (int)src.Id)) + src.Id)) .ForMember(dest => dest.FilterListIds, opt => opt.MapFrom(src => src.FilterListTags - .Select(ft => (int)ft.FilterListId))); + .Select(ft => ft.FilterListId))); } } \ No newline at end of file