convert unsigned to signed keys in data layer

closes #593
This commit is contained in:
Collin M. Barrett 2018-10-18 17:45:55 -05:00
parent ad1734b9b4
commit 95ef1b6059
44 changed files with 1729 additions and 112 deletions

View file

@ -0,0 +1,684 @@
// <auto-generated />
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<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<string>("ChatUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DescriptionSourceUrl")
.HasColumnType("TEXT");
b.Property<string>("DonateUrl")
.HasColumnType("TEXT");
b.Property<string>("EmailAddress")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(126)")
.HasDefaultValueSql("NULL");
b.Property<string>("ForumUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<string>("IssuesUrl")
.HasColumnType("TEXT");
b.Property<short?>("LicenseId")
.ValueGeneratedOnAdd()
.HasDefaultValue((short)5);
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("VARCHAR(126)");
b.Property<string>("PolicyUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("PublishedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
b.Property<string>("SubmissionUrl")
.HasColumnType("TEXT");
b.Property<short?>("SyntaxId");
b.Property<DateTime?>("UpdatedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
b.Property<string>("ViewUrl")
.HasColumnType("TEXT");
b.Property<string>("ViewUrlMirror1")
.HasColumnType("TEXT");
b.Property<string>("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<short>("DependentFilterListId");
b.Property<short>("DependencyFilterListId");
b.Property<DateTime?>("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<short>("FilterListId");
b.Property<short>("LanguageId");
b.Property<DateTime?>("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<short>("FilterListId");
b.Property<short>("MaintainerId");
b.Property<DateTime?>("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<short>("FilterListId");
b.Property<short>("TagId");
b.Property<DateTime?>("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<short>("ForkFilterListId");
b.Property<short>("UpstreamFilterListId");
b.Property<DateTime?>("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<short>("MergeFilterListId");
b.Property<short>("UpstreamFilterListId");
b.Property<DateTime?>("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<int>("SnapshotId");
b.Property<int>("RuleId");
b.HasKey("SnapshotId", "RuleId");
b.HasIndex("RuleId");
b.ToTable("snapshots_rules");
});
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b =>
{
b.Property<short>("SyntaxId");
b.Property<short>("SoftwareId");
b.Property<DateTime?>("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<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("Iso6391")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(2)")
.HasDefaultValueSql("NULL");
b.Property<string>("Iso6392")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(3)")
.HasDefaultValueSql("NULL");
b.Property<string>("Iso6392B")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(3)")
.HasDefaultValueSql("NULL");
b.Property<string>("Iso6392T")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(3)")
.HasDefaultValueSql("NULL");
b.Property<string>("Iso6393")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(3)")
.HasDefaultValueSql("NULL");
b.Property<string>("LocalName")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(126)")
.HasDefaultValueSql("NULL");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(126)")
.HasDefaultValueSql("NULL");
b.HasKey("Id");
b.ToTable("languages");
});
modelBuilder.Entity("FilterLists.Data.Entities.License", b =>
{
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("DescriptionUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("VARCHAR(126)");
b.Property<bool>("PermissiveAdaptation");
b.Property<bool>("PermissiveCommercial");
b.HasKey("Id");
b.ToTable("licenses");
});
modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b =>
{
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("EmailAddress")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(126)")
.HasDefaultValueSql("NULL");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("VARCHAR(126)");
b.Property<string>("TwitterHandle")
.ValueGeneratedOnAdd()
.HasColumnType("VARCHAR(126)")
.HasDefaultValueSql("NULL");
b.HasKey("Id");
b.ToTable("maintainers");
});
modelBuilder.Entity("FilterLists.Data.Entities.Rule", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("Raw")
.IsRequired()
.HasColumnType("LONGTEXT");
b.HasKey("Id");
b.ToTable("rules");
});
modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("MEDIUMINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<short>("FilterListId");
b.Property<short?>("HttpStatusCode")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasDefaultValueSql("NULL");
b.Property<byte[]>("Md5Checksum")
.HasColumnType("BINARY(16)");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<bool>("WasSuccessful");
b.Property<bool>("WasUpdated");
b.Property<DateTime?>("WaybackTimestamp")
.HasColumnType("TIMESTAMP");
b.Property<string>("WaybackUrl")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("FilterListId");
b.ToTable("snapshots");
});
modelBuilder.Entity("FilterLists.Data.Entities.Software", b =>
{
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("DownloadUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<bool>("IsAbpSubscribable");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("VARCHAR(126)");
b.HasKey("Id");
b.ToTable("software");
});
modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b =>
{
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("DefinitionUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("VARCHAR(126)");
b.HasKey("Id");
b.ToTable("syntaxes");
});
modelBuilder.Entity("FilterLists.Data.Entities.Tag", b =>
{
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp() ON UPDATE current_timestamp()");
b.Property<string>("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
}
}
}

View file

@ -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<short>(
"Id",
"tags",
"SMALLINT",
nullable: false,
oldClrType: typeof(byte),
oldType: "TINYINT UNSIGNED")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<short>(
"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<short>(
"Id",
"syntaxes",
"SMALLINT",
nullable: false,
oldClrType: typeof(byte),
oldType: "TINYINT UNSIGNED")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<short>(
"SyntaxId",
"filterlists",
nullable: true,
oldClrType: typeof(byte),
oldNullable: true);
migrationBuilder.AddFK_filterlists_syntaxes_SyntaxId();
migrationBuilder.AlterColumn<short>(
"SyntaxId",
"software_syntaxes",
nullable: false,
oldClrType: typeof(byte));
migrationBuilder.AddFK_software_syntaxes_syntaxes_SyntaxId();
migrationBuilder.DropFK_software_syntaxes_software_SoftwareId();
migrationBuilder.AlterColumn<short>(
"SoftwareId",
"software_syntaxes",
nullable: false,
oldClrType: typeof(byte));
migrationBuilder.AlterColumn<short>(
"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<int>(
"RuleId",
"snapshots_rules",
nullable: false,
oldClrType: typeof(uint));
migrationBuilder.AlterColumn<int>(
"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<int>(
"SnapshotId",
"snapshots_rules",
nullable: false,
oldClrType: typeof(uint));
migrationBuilder.AlterColumn<int>(
"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<short>(
"FilterListId",
"snapshots",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_merges_filterlists_UpstreamFilterListId();
migrationBuilder.AlterColumn<short>(
"UpstreamFilterListId",
"merges",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_merges_filterlists_MergeFilterListId();
migrationBuilder.AlterColumn<short>(
"MergeFilterListId",
"merges",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_forks_filterlists_UpstreamFilterListId();
migrationBuilder.AlterColumn<short>(
"UpstreamFilterListId",
"forks",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_forks_filterlists_ForkFilterListId();
migrationBuilder.AlterColumn<short>(
"ForkFilterListId",
"forks",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_filterlists_tags_filterlists_FilterListId();
migrationBuilder.AlterColumn<short>(
"FilterListId",
"filterlists_tags",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_filterlists_maintainers_filterlists_FilterListId();
migrationBuilder.AlterColumn<short>(
"FilterListId",
"filterlists_maintainers",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_filterlists_languages_filterlists_FilterListId();
migrationBuilder.AlterColumn<short>(
"FilterListId",
"filterlists_languages",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.DropFK_dependents_filterlists_DependencyFilterListId();
migrationBuilder.DropFK_dependents_filterlists_DependentFilterListId();
migrationBuilder.AlterColumn<short>(
"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<short>(
"DependencyFilterListId",
"dependents",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.AddFK_dependents_filterlists_DependencyFilterListId();
migrationBuilder.AlterColumn<short>(
"DependentFilterListId",
"dependents",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.AddFK_dependents_filterlists_DependentFilterListId();
migrationBuilder.DropFK_filterlists_maintainers_maintainers_MaintainerId();
migrationBuilder.AlterColumn<short>(
"Id",
"maintainers",
"SMALLINT",
nullable: false,
oldClrType: typeof(ushort),
oldType: "SMALLINT UNSIGNED")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<short>(
"MaintainerId",
"filterlists_maintainers",
nullable: false,
oldClrType: typeof(ushort));
migrationBuilder.AddFK_filterlists_maintainers_maintainers_MaintainerId();
migrationBuilder.DropFK_filterlists_licenses_LicenseId();
migrationBuilder.AlterColumn<short>(
"Id",
"licenses",
"SMALLINT",
nullable: false,
oldClrType: typeof(byte),
oldType: "TINYINT UNSIGNED")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<short>(
"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<short>(
"Id",
"languages",
"SMALLINT",
nullable: false,
oldClrType: typeof(ushort),
oldType: "SMALLINT UNSIGNED")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<short>(
"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<byte>(
"Id",
"tags",
"TINYINT UNSIGNED",
nullable: false,
oldClrType: typeof(short),
oldType: "SMALLINT")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<byte>(
"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<byte>(
"Id",
"syntaxes",
"TINYINT UNSIGNED",
nullable: false,
oldClrType: typeof(short),
oldType: "SMALLINT")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<byte>(
"SyntaxId",
"filterlists",
nullable: true,
oldClrType: typeof(short),
oldNullable: true);
migrationBuilder.AddFK_filterlists_syntaxes_SyntaxId();
migrationBuilder.AlterColumn<byte>(
"SyntaxId",
"software_syntaxes",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AddFK_software_syntaxes_syntaxes_SyntaxId();
migrationBuilder.DropFK_software_syntaxes_software_SoftwareId();
migrationBuilder.AlterColumn<byte>(
"SoftwareId",
"software_syntaxes",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AlterColumn<byte>(
"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<uint>(
"RuleId",
"snapshots_rules",
nullable: false,
oldClrType: typeof(int));
migrationBuilder.AlterColumn<uint>(
"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<uint>(
"SnapshotId",
"snapshots_rules",
nullable: false,
oldClrType: typeof(int));
migrationBuilder.AlterColumn<uint>(
"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<ushort>(
"FilterListId",
"snapshots",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_merges_filterlists_UpstreamFilterListId();
migrationBuilder.AlterColumn<ushort>(
"UpstreamFilterListId",
"merges",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_merges_filterlists_MergeFilterListId();
migrationBuilder.AlterColumn<ushort>(
"MergeFilterListId",
"merges",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_forks_filterlists_UpstreamFilterListId();
migrationBuilder.AlterColumn<ushort>(
"UpstreamFilterListId",
"forks",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_forks_filterlists_ForkFilterListId();
migrationBuilder.AlterColumn<ushort>(
"ForkFilterListId",
"forks",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_filterlists_tags_filterlists_FilterListId();
migrationBuilder.AlterColumn<ushort>(
"FilterListId",
"filterlists_tags",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_filterlists_maintainers_filterlists_FilterListId();
migrationBuilder.AlterColumn<ushort>(
"FilterListId",
"filterlists_maintainers",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_filterlists_languages_filterlists_FilterListId();
migrationBuilder.AlterColumn<ushort>(
"FilterListId",
"filterlists_languages",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.DropFK_dependents_filterlists_DependencyFilterListId();
migrationBuilder.DropFK_dependents_filterlists_DependentFilterListId();
migrationBuilder.AlterColumn<ushort>(
"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<ushort>(
"DependencyFilterListId",
"dependents",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AddFK_dependents_filterlists_DependencyFilterListId();
migrationBuilder.AlterColumn<ushort>(
"DependentFilterListId",
"dependents",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AddFK_dependents_filterlists_DependentFilterListId();
migrationBuilder.DropFK_filterlists_maintainers_maintainers_MaintainerId();
migrationBuilder.AlterColumn<ushort>(
"Id",
"maintainers",
"SMALLINT UNSIGNED",
nullable: false,
oldClrType: typeof(short),
oldType: "SMALLINT")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<ushort>(
"MaintainerId",
"filterlists_maintainers",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AddFK_filterlists_maintainers_maintainers_MaintainerId();
migrationBuilder.DropFK_filterlists_licenses_LicenseId();
migrationBuilder.AlterColumn<byte>(
"Id",
"licenses",
"TINYINT UNSIGNED",
nullable: false,
oldClrType: typeof(short),
oldType: "SMALLINT")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<byte>(
"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<ushort>(
"Id",
"languages",
"SMALLINT UNSIGNED",
nullable: false,
oldClrType: typeof(short),
oldType: "SMALLINT")
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
.OldAnnotation("MySql:ValueGenerationStrategy",
MySqlValueGenerationStrategy.IdentityColumn);
migrationBuilder.AlterColumn<ushort>(
"LanguageId",
"filterlists_languages",
nullable: false,
oldClrType: typeof(short));
migrationBuilder.AddFK_filterlists_languages_languages_LanguageId();
}
}
}

View file

@ -21,5 +21,345 @@ public static OperationBuilder<SqlOperation> 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);
}
}
}

View file

@ -20,9 +20,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
{
b.Property<ushort>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<string>("ChatUrl")
@ -57,9 +57,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("IssuesUrl")
.HasColumnType("TEXT");
b.Property<byte?>("LicenseId")
b.Property<short?>("LicenseId")
.ValueGeneratedOnAdd()
.HasDefaultValue((byte)5);
.HasDefaultValue((short)5);
b.Property<DateTime?>("ModifiedDateUtc")
.IsRequired()
@ -82,7 +82,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("SubmissionUrl")
.HasColumnType("TEXT");
b.Property<byte?>("SyntaxId");
b.Property<short?>("SyntaxId");
b.Property<DateTime?>("UpdatedDate")
.ValueGeneratedOnAdd()
@ -109,9 +109,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Dependent", b =>
{
b.Property<ushort>("DependentFilterListId");
b.Property<short>("DependentFilterListId");
b.Property<ushort>("DependencyFilterListId");
b.Property<short>("DependencyFilterListId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -128,9 +128,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b =>
{
b.Property<ushort>("FilterListId");
b.Property<short>("FilterListId");
b.Property<ushort>("LanguageId");
b.Property<short>("LanguageId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -147,9 +147,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b =>
{
b.Property<ushort>("FilterListId");
b.Property<short>("FilterListId");
b.Property<ushort>("MaintainerId");
b.Property<short>("MaintainerId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -166,9 +166,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListTag", b =>
{
b.Property<ushort>("FilterListId");
b.Property<short>("FilterListId");
b.Property<byte>("TagId");
b.Property<short>("TagId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -185,9 +185,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b =>
{
b.Property<ushort>("ForkFilterListId");
b.Property<short>("ForkFilterListId");
b.Property<ushort>("UpstreamFilterListId");
b.Property<short>("UpstreamFilterListId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -204,9 +204,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b =>
{
b.Property<ushort>("MergeFilterListId");
b.Property<short>("MergeFilterListId");
b.Property<ushort>("UpstreamFilterListId");
b.Property<short>("UpstreamFilterListId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -223,9 +223,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SnapshotRule", b =>
{
b.Property<uint>("SnapshotId");
b.Property<int>("SnapshotId");
b.Property<uint>("RuleId");
b.Property<int>("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<byte>("SyntaxId");
b.Property<short>("SyntaxId");
b.Property<byte>("SoftwareId");
b.Property<short>("SoftwareId");
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
@ -255,9 +255,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Language", b =>
{
b.Property<ushort>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -314,9 +314,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.License", b =>
{
b.Property<byte>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -349,9 +349,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b =>
{
b.Property<ushort>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -390,9 +390,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Rule", b =>
{
b.Property<uint>("Id")
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INT UNSIGNED")
.HasColumnType("INT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -412,9 +412,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b =>
{
b.Property<uint>("Id")
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("MEDIUMINT UNSIGNED")
.HasColumnType("MEDIUMINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -423,7 +423,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<ushort>("FilterListId");
b.Property<short>("FilterListId");
b.Property<short?>("HttpStatusCode")
.ValueGeneratedOnAdd()
@ -458,9 +458,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Software", b =>
{
b.Property<byte>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -494,9 +494,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b =>
{
b.Property<byte>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
@ -525,9 +525,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
modelBuilder.Entity("FilterLists.Data.Entities.Tag", b =>
{
b.Property<byte>("Id")
b.Property<short>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.HasColumnType("SMALLINT")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")

View file

@ -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; }
}

View file

@ -21,7 +21,7 @@ public class FilterList : BaseEntity
public string HomeUrl { get; set; }
public string IssuesUrl { get; set; }
public ICollection<FilterListLanguage> FilterListLanguages { get; set; }
public uint? LicenseId { get; set; }
public int? LicenseId { get; set; }
public License License { get; set; }
public ICollection<FilterListMaintainer> FilterListMaintainers { get; set; }
public ICollection<Merge> MergeFilterLists { get; set; }
@ -31,7 +31,7 @@ public class FilterList : BaseEntity
public DateTime? PublishedDate { get; set; }
public ICollection<Snapshot> 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<FilterListTag> FilterListTags { get; set; }
public DateTime? UpdatedDate { get; set; }

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }

View file

@ -10,7 +10,7 @@ public virtual void Configure(EntityTypeBuilder<TEntity> entityTypeBuilder)
{
entityTypeBuilder.Property(x => x.Id)
.UseMySqlIdentityColumn()
.HasColumnType("SMALLINT UNSIGNED");
.HasColumnType("SMALLINT");
entityTypeBuilder.Property(x => x.CreatedDateUtc)
.HasColumnType("TIMESTAMP")
.ValueGeneratedOnAdd()

View file

@ -28,7 +28,7 @@ public override void Configure(EntityTypeBuilder<FilterList> 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();

View file

@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder<License> 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)

View file

@ -11,7 +11,7 @@ public override void Configure(EntityTypeBuilder<Rule> 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")

View file

@ -11,7 +11,7 @@ public override void Configure(EntityTypeBuilder<Snapshot> 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");

View file

@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder<Software> 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)

View file

@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder<Syntax> 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)

View file

@ -10,8 +10,6 @@ public override void Configure(EntityTypeBuilder<Tag> entityTypeBuilder)
{
base.Configure(entityTypeBuilder);
entityTypeBuilder.ToTable("tags");
entityTypeBuilder.Property(x => x.Id)
.HasColumnType("TINYINT UNSIGNED");
entityTypeBuilder.Property(x => x.Name)
.HasColumnType("VARCHAR(126)")
.IsRequired();

View file

@ -13,18 +13,18 @@ public FilterListDtoMappingProfile() =>
CreateMap<Data.Entities.FilterList, FilterListDto>()
.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

View file

@ -12,10 +12,10 @@ public LanguageDtoMappingProfile() =>
CreateMap<Data.Entities.Language, LanguageDto>()
.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)));
}
}

View file

@ -12,10 +12,10 @@ public LicenseDtoMappingProfile() =>
CreateMap<Data.Entities.License, LicenseDto>()
.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)));
}
}

View file

@ -12,10 +12,10 @@ public MaintainerDtoMappingProfile() =>
CreateMap<Data.Entities.Maintainer, MaintainerDto>()
.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)));
}
}

View file

@ -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; }

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }
}
}

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }

View file

@ -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; }
}

View file

@ -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; }
}

View file

@ -12,10 +12,10 @@ public SoftwareDtoMappingProfile() =>
CreateMap<Data.Entities.Software, SoftwareDto>()
.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)));
}
}

View file

@ -12,14 +12,14 @@ public SyntaxDtoMappingProfile() =>
CreateMap<Data.Entities.Syntax, SyntaxDto>()
.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)));
}
}

View file

@ -12,10 +12,10 @@ public TagDtoMappingProfile() =>
CreateMap<Data.Entities.Tag, TagDto>()
.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)));
}
}