rename discontinuedDate to updatedDate (since they mean the same thing)

closes #485 , ref #544
This commit is contained in:
Collin M. Barrett 2018-10-05 13:46:55 -05:00
parent 0313a2a86a
commit 8c22569622
19 changed files with 1582 additions and 156 deletions

File diff suppressed because it is too large Load diff

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("20181005170600_RenameDiscontinuedToUpdated")]
partial class RenameDiscontinuedToUpdated
{
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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<byte?>("LicenseId")
.ValueGeneratedOnAdd()
.HasDefaultValue((byte)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("DATE")
.HasDefaultValueSql("NULL");
b.Property<string>("SubmissionUrl")
.HasColumnType("TEXT");
b.Property<byte?>("SyntaxId");
b.Property<DateTime?>("UpdatedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATE")
.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<ushort>("DependentFilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<byte>("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<ushort>("ForkFilterListId");
b.Property<ushort>("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<ushort>("MergeFilterListId");
b.Property<ushort>("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<uint>("SnapshotId");
b.Property<uint>("RuleId");
b.HasKey("SnapshotId", "RuleId");
b.HasIndex("RuleId");
b.ToTable("snapshots_rules");
});
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b =>
{
b.Property<byte>("SyntaxId");
b.Property<byte>("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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<uint>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INT UNSIGNED")
.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<uint>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("MEDIUMINT UNSIGNED")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<ushort>("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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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,23 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace FilterLists.Api.Migrations
{
public partial class RenameDiscontinuedToUpdated : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
"DiscontinuedDate",
"filterlists",
"UpdatedDate");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
"UpdatedDate",
"filterlists",
"DiscontinuedDate");
}
}
}

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("20181005182658_ConvertPublishedAndUpdatedToDateTime")]
partial class ConvertPublishedAndUpdatedToDateTime
{
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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<byte?>("LicenseId")
.ValueGeneratedOnAdd()
.HasDefaultValue((byte)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<byte?>("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<ushort>("DependentFilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<ushort>("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<ushort>("FilterListId");
b.Property<byte>("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<ushort>("ForkFilterListId");
b.Property<ushort>("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<ushort>("MergeFilterListId");
b.Property<ushort>("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<uint>("SnapshotId");
b.Property<uint>("RuleId");
b.HasKey("SnapshotId", "RuleId");
b.HasIndex("RuleId");
b.ToTable("snapshots_rules");
});
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b =>
{
b.Property<byte>("SyntaxId");
b.Property<byte>("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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<ushort>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("SMALLINT UNSIGNED")
.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<uint>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("INT UNSIGNED")
.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<uint>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("MEDIUMINT UNSIGNED")
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn);
b.Property<DateTime?>("CreatedDateUtc")
.IsRequired()
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP")
.HasDefaultValueSql("current_timestamp()");
b.Property<ushort>("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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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<byte>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TINYINT UNSIGNED")
.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,58 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
namespace FilterLists.Api.Migrations
{
public partial class ConvertPublishedAndUpdatedToDateTime : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
"UpdatedDate",
"filterlists",
"DATETIME",
nullable: true,
defaultValueSql: "NULL",
oldClrType: typeof(DateTime),
oldType: "DATE",
oldNullable: true,
oldDefaultValueSql: "NULL");
migrationBuilder.AlterColumn<DateTime>(
"PublishedDate",
"filterlists",
"DATETIME",
nullable: true,
defaultValueSql: "NULL",
oldClrType: typeof(DateTime),
oldType: "DATE",
oldNullable: true,
oldDefaultValueSql: "NULL");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<DateTime>(
"UpdatedDate",
"filterlists",
"DATE",
nullable: true,
defaultValueSql: "NULL",
oldClrType: typeof(DateTime),
oldType: "DATETIME",
oldNullable: true,
oldDefaultValueSql: "NULL");
migrationBuilder.AlterColumn<DateTime>(
"PublishedDate",
"filterlists",
"DATE",
nullable: true,
defaultValueSql: "NULL",
oldClrType: typeof(DateTime),
oldType: "DATETIME",
oldNullable: true,
oldDefaultValueSql: "NULL");
}
}
}

View file

@ -15,7 +15,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("ProductVersion", "2.1.3-rtm-32065")
.HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
.HasAnnotation("Relational:MaxIdentifierLength", 64);
modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
@ -40,11 +40,6 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<string>("DescriptionSourceUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("DiscontinuedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATE")
.HasDefaultValueSql("NULL");
b.Property<string>("DonateUrl")
.HasColumnType("TEXT");
@ -81,7 +76,7 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<DateTime?>("PublishedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATE")
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
b.Property<string>("SubmissionUrl")
@ -89,6 +84,11 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property<byte?>("SyntaxId");
b.Property<DateTime?>("UpdatedDate")
.ValueGeneratedOnAdd()
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
b.Property<string>("ViewUrl")
.HasColumnType("TEXT");

View file

@ -13,7 +13,6 @@ public class FilterList : BaseEntity
public ICollection<Dependent> DependencyFilterLists { get; set; }
public string Description { get; set; }
public string DescriptionSourceUrl { get; set; }
public DateTime? DiscontinuedDate { get; set; }
public string DonateUrl { get; set; }
public string EmailAddress { get; set; }
public ICollection<Fork> ForkFilterLists { get; set; }
@ -35,6 +34,7 @@ public class FilterList : BaseEntity
public uint? SyntaxId { get; set; }
public Syntax Syntax { get; set; }
public ICollection<FilterListTag> FilterListTags { get; set; }
public DateTime? UpdatedDate { get; set; }
public string ViewUrl { get; set; }
public string ViewUrlMirror1 { get; set; }
public string ViewUrlMirror2 { get; set; }

View file

@ -16,9 +16,6 @@ public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.DescriptionSourceUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.DiscontinuedDate)
.HasColumnType("DATE")
.HasDefaultValueSql("NULL");
entityTypeBuilder.Property(x => x.DonateUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.EmailAddress)
@ -38,10 +35,13 @@ public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
entityTypeBuilder.Property(x => x.PolicyUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.PublishedDate)
.HasColumnType("DATE")
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
entityTypeBuilder.Property(x => x.SubmissionUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.UpdatedDate)
.HasColumnType("DATETIME")
.HasDefaultValueSql("NULL");
entityTypeBuilder.Property(x => x.ViewUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.ViewUrlMirror1)

View file

@ -106,8 +106,8 @@ private static List<IProperty> GetPropertiesLessValueGeneratedTimestamps(IEntity
{
"CreatedDateUtc",
"ModifiedDateUtc",
"DiscontinuedDate",
"PublishedDate"
"PublishedDate",
"UpdatedDate"
}.Contains(x.Name))
.ToList();

View file

@ -38,17 +38,6 @@ public FilterListDtoMappingProfile() =>
opt => opt.MapFrom(src =>
src.FilterListTags
.Select(lt => (int)lt.TagId)))
.ForMember(dest => dest.UpdatedDate,
opt => opt.MapFrom(src =>
src.DiscontinuedDate ??
(src.Snapshots
.Count(s => s.WasSuccessful && s.WasUpdated) >= 2
? src.Snapshots
.Where(s => s.WasSuccessful && s.WasUpdated)
.Select(s => s.CreatedDateUtc)
.OrderByDescending(c => c)
.FirstOrDefault()
: null)))
.ForMember(dest => dest.ViewUrlMirrors,
opt => opt.MapFrom(src =>
src.ViewUrlMirror1 != null

View file

@ -11,7 +11,6 @@ public class FilterListDto
public string ChatUrl { get; set; }
public string Description { get; set; }
public string DescriptionSourceUrl { get; set; }
public DateTime? DiscontinuedDate { get; set; }
public string DonateUrl { get; set; }
public string EmailAddress { get; set; }
public string ForumUrl { get; set; }

View file

@ -10,7 +10,6 @@ public class FilterListSeedDto
public string ChatUrl { get; set; }
public string Description { get; set; }
public string DescriptionSourceUrl { get; set; }
public DateTime? DiscontinuedDate { get; set; }
public string DonateUrl { get; set; }
public string EmailAddress { get; set; }
public string ForumUrl { get; set; }
@ -22,6 +21,7 @@ public class FilterListSeedDto
public DateTime? PublishedDate { get; set; }
public string SubmissionUrl { get; set; }
public uint? SyntaxId { get; set; }
public DateTime? UpdatedDate { get; set; }
public string ViewUrl { get; set; }
public string ViewUrlMirror1 { get; set; }
public string ViewUrlMirror2 { get; set; }

View file

@ -28,8 +28,10 @@ public class Snapshot
private readonly Logger logger;
private readonly string uaString;
protected string ListUrl;
private Data.Entities.FilterList filterList;
private bool isUpdatedDateFromGitHub;
private HashSet<string> lines;
public Snapshot()
{
}
@ -56,7 +58,7 @@ protected async Task TrySaveAsyncBase()
await AddSnapEntity();
if (!ListUrl.IsValidHttpOrHttpsUrl())
return;
await UpdateDates();
await UpdateDatesFromGitHub();
try
{
await SaveAsync();
@ -73,28 +75,36 @@ private async Task AddSnapEntity()
await dbContext.SaveChangesAsync();
}
private async Task UpdateDates()
private async Task UpdateDatesFromGitHub()
{
var dates = await gitHubService.GetCommitDatesAsync(ListUrl);
if (dates is null)
return;
var list = await dbContext.FilterLists.FirstOrDefaultAsync(l => l.Id == List.Id);
UpdatePublishedDate(dates.First, list);
UpdateDiscontinuedDate(dates.Last, list);
var list = await GetList();
UpdatePublishedDateFromGitHub(dates.First, list);
UpdateUpdatedDateFromGitHub(dates.Last, list);
await dbContext.SaveChangesAsync();
}
private static void UpdatePublishedDate(DateTime? date, Data.Entities.FilterList list)
private async Task<Data.Entities.FilterList> GetList()
{
filterList = filterList ?? await dbContext.FilterLists.FirstOrDefaultAsync(l => l.Id == List.Id);
return filterList;
}
private static void UpdatePublishedDateFromGitHub(DateTime? date, Data.Entities.FilterList list)
{
if (date is DateTime firstDate && (list.PublishedDate is null || firstDate < list.PublishedDate))
list.PublishedDate = firstDate;
}
private static void UpdateDiscontinuedDate(DateTime? date, Data.Entities.FilterList list)
private void UpdateUpdatedDateFromGitHub(DateTime? date, Data.Entities.FilterList list)
{
if (date is DateTime lastDate && lastDate < DateTime.Now.AddYears(-2) &&
(list.DiscontinuedDate is null || lastDate > list.DiscontinuedDate))
list.DiscontinuedDate = lastDate;
if (date is DateTime lastDate && (list.UpdatedDate is null || lastDate > list.UpdatedDate))
{
list.UpdatedDate = lastDate;
isUpdatedDateFromGitHub = true;
}
}
private async Task SaveAsync()
@ -152,7 +162,7 @@ private async Task GetLinesFromSource(HttpResponseMessage response)
await SetWasUpdated();
if (SnapEntity.WasUpdated)
{
await UpdateDiscontinuedDate();
await UpdateUpdatedDate();
memoryStream.Position = 0;
if (ListUrl.EndsWith(".7z"))
await GetLinesFrom7Zip(memoryStream);
@ -182,11 +192,12 @@ await dbContext.Snapshots
.Select(s => s.Md5Checksum)
.FirstOrDefaultAsync() ?? Array.Empty<byte>();
private async Task UpdateDiscontinuedDate()
private async Task UpdateUpdatedDate()
{
var list = await dbContext.FilterLists.FirstOrDefaultAsync(l => l.Id == List.Id);
if (!(list.DiscontinuedDate is null) && DateTime.Now > list.DiscontinuedDate)
list.DiscontinuedDate = null;
if (isUpdatedDateFromGitHub)
return;
var list = await GetList();
list.UpdatedDate = DateTime.Now;
}
private async Task GetLinesFrom7Zip(Stream stream)

View file

@ -5,7 +5,6 @@ export interface IListDetails {
chatUrl: string;
description: string;
descriptionSourceUrl: string;
discontinuedDate: string;
donateUrl: string;
emailAddress: string;
forumUrl: string;

View file

@ -1,13 +0,0 @@
import * as React from "react";
import * as moment from "moment";
interface IProps {
date: string;
};
export const DiscontinuedDate = (props: IProps) =>
props.date
? <li className="list-group-item">
<p>Discontinued: {moment(props.date).format("l")}</p>
</li>
: null;

View file

@ -2,7 +2,6 @@ import * as React from "react";
import { IColumnVisibility } from "../../../interfaces";
import { ILanguage, ILicense, ISoftware, ISyntax, ITag } from "../../../interfaces";
import { Description } from "./Description";
import { DiscontinuedDate } from "./DiscontinuedDate";
import { Languages } from "./Languages";
import { License } from "./License";
import { PublishedDate } from "./PublishedDate";
@ -16,7 +15,6 @@ interface IProps {
columnVisibility: IColumnVisibility[];
description: string;
descriptionSourceUrl: string;
discontinuedDate: string;
languages: ILanguage[];
license: ILicense;
name: string;
@ -47,7 +45,6 @@ export const InfoCard = (props: IProps) =>
{props.columnVisibility.filter((c: IColumnVisibility) => c.column === "Rules")[0].visible
? null
: <RuleCount {...props}/>}
<DiscontinuedDate date={props.discontinuedDate}/>
{props.columnVisibility.filter((c: IColumnVisibility) => c.column === "Updated")[0].visible
? null
: <UpdatedDate {...props}/>}

View file

@ -2,17 +2,14 @@ import * as React from "react";
import * as moment from "moment";
interface IProps {
discontinuedDate: string;
updatedDate: string;
};
export const UpdatedDate = (props: IProps) =>
props.discontinuedDate
? null
: props.updatedDate
? <li className="list-group-item">
<p>Updated: {moment(props.updatedDate).isValid()
? moment(props.updatedDate).format("l")
: "N/A"}</p>
</li>
: null;
props.updatedDate
? <li className="list-group-item">
<p>Updated: {moment(props.updatedDate).isValid()
? moment(props.updatedDate).format("l")
: "N/A"}</p>
</li>
: null;

View file

@ -68,7 +68,6 @@ const mapListDetails = (props: ICreateListDtoProps): IListDetails =>
chatUrl: props.list.chatUrl,
description: props.list.description,
descriptionSourceUrl: props.list.descriptionSourceUrl,
discontinuedDate: props.list.discontinuedDate,
donateUrl: props.list.donateUrl,
emailAddress: props.list.emailAddress,
forumUrl: props.list.forumUrl,

View file

@ -3,7 +3,6 @@
chatUrl: string;
description: string;
descriptionSourceUrl: string;
discontinuedDate: string;
donateUrl: string;
emailAddress: string;
forumUrl: string;