diff --git a/.github/README.md b/.github/README.md
index 3bb417e4b..f82aa5ee1 100644
--- a/.github/README.md
+++ b/.github/README.md
@@ -33,6 +33,7 @@ The immediate projects are converting the data to an actual web application (rat
|----------------------|--------------------------------------------------------------------------|
| Description | The list's functionality |
| DescriptionSourceUrl | The list's Description source URL if quoted directly |
+| DiscontinuedDate | The list's date of discontinuation as expressed by the maintainer |
| DonateUrl | The list's donation URL |
| EmailAddress | The list's email address |
| ForumUrl | The list's forum URL |
@@ -43,8 +44,9 @@ The immediate projects are converting the data to an actual web application (rat
| *Maintainer | The list's maintainer |
| Name | The list's name (APA Title Case) |
| SubmissionUrl | The list's submission form URL |
+| *Syntax | The list's syntax (uBlock Origin, Adblock Plus, hosts, etc.) |
| *UpstreamFilterLists | The list's upstream lists if it is a fork or a merge |
-| ViewUrl | The list's view/download URL (typically .txt file) |
+| ViewUrl | The list's view/download URL (typically .txt file) |
### Maintainers
diff --git a/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs b/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs
new file mode 100644
index 000000000..f957e33c8
--- /dev/null
+++ b/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs
@@ -0,0 +1,480 @@
+//
+using FilterLists.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage;
+using Microsoft.EntityFrameworkCore.Storage.Internal;
+using System;
+
+namespace FilterLists.Api.Migrations
+{
+ [DbContext(typeof(FilterListsDbContext))]
+ [Migration("20171104143224_add Syntax entity")]
+ partial class addSyntaxentity
+ {
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
+ .HasAnnotation("ProductVersion", "2.0.0-rtm-26452");
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Description")
+ .HasMaxLength(4096);
+
+ b.Property("DescriptionSourceUrl")
+ .HasMaxLength(2083);
+
+ b.Property("DiscontinuedDate");
+
+ b.Property("DonateUrl")
+ .HasMaxLength(2083);
+
+ b.Property("EmailAddress")
+ .HasMaxLength(126);
+
+ b.Property("ForumUrl")
+ .HasMaxLength(2083);
+
+ b.Property("HomeUrl")
+ .HasMaxLength(2083);
+
+ b.Property("IssuesUrl")
+ .HasMaxLength(2083);
+
+ b.Property("LicenseId");
+
+ b.Property("MaintainerId");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(126);
+
+ b.Property("SubmissionUrl")
+ .HasMaxLength(2083);
+
+ b.Property("SyntaxId");
+
+ b.Property("ViewUrl")
+ .HasMaxLength(2083);
+
+ b.HasKey("Id");
+
+ b.HasIndex("LicenseId");
+
+ b.HasIndex("MaintainerId");
+
+ b.HasIndex("SyntaxId");
+
+ b.ToTable("filterlists");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterListLanguage", b =>
+ {
+ b.Property("FilterListId");
+
+ b.Property("LanguageId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("FilterListId", "LanguageId");
+
+ b.HasIndex("LanguageId");
+
+ b.ToTable("filterlists_languages");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterListRule", b =>
+ {
+ b.Property("FilterListId");
+
+ b.Property("RuleId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("FilterListId", "RuleId");
+
+ b.HasIndex("RuleId");
+
+ b.ToTable("filterlists_rules");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterListSoftware", b =>
+ {
+ b.Property("FilterListId");
+
+ b.Property("SoftwareId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("FilterListId", "SoftwareId");
+
+ b.HasIndex("SoftwareId");
+
+ b.ToTable("filterlists_software");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Fork", b =>
+ {
+ b.Property("ForkFilterListId");
+
+ b.Property("UpstreamFilterListId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("ForkFilterListId", "UpstreamFilterListId");
+
+ b.HasIndex("UpstreamFilterListId");
+
+ b.ToTable("forks");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Language", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Iso6391")
+ .HasMaxLength(2);
+
+ b.Property("Iso6392")
+ .HasMaxLength(3);
+
+ b.Property("Iso6392B")
+ .HasMaxLength(3);
+
+ b.Property("Iso6392T")
+ .HasMaxLength(3);
+
+ b.Property("Iso6393")
+ .HasMaxLength(3);
+
+ b.Property("LocalName")
+ .HasMaxLength(126);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .HasMaxLength(126);
+
+ b.HasKey("Id");
+
+ b.ToTable("languages");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.License", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("DescriptionUrl")
+ .HasMaxLength(2083);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(126);
+
+ b.Property("PermissiveAdaptation");
+
+ b.Property("PermissiveCommercial");
+
+ b.HasKey("Id");
+
+ b.ToTable("licenses");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("EmailAddress")
+ .HasMaxLength(126);
+
+ b.Property("HomeUrl")
+ .HasMaxLength(2083);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(126);
+
+ b.Property("TwitterHandle")
+ .HasMaxLength(126);
+
+ b.HasKey("Id");
+
+ b.ToTable("maintainers");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Merge", b =>
+ {
+ b.Property("MergeFilterListId");
+
+ b.Property("UpstreamFilterListId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("MergeFilterListId", "UpstreamFilterListId");
+
+ b.HasIndex("UpstreamFilterListId");
+
+ b.ToTable("merges");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Rule", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Raw")
+ .HasMaxLength(2083);
+
+ b.HasKey("Id");
+
+ b.ToTable("rules");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Software", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("DownloadUrl")
+ .HasMaxLength(2083);
+
+ b.Property("HomeUrl")
+ .HasMaxLength(2083);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .HasMaxLength(126);
+
+ b.HasKey("Id");
+
+ b.ToTable("software");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.SoftwareSyntax", b =>
+ {
+ b.Property("SoftwareId");
+
+ b.Property("SyntaxId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("SoftwareId", "SyntaxId");
+
+ b.HasIndex("SyntaxId");
+
+ b.ToTable("software_syntaxes");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("DefinitionUrl")
+ .HasMaxLength(2083);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(126);
+
+ b.HasKey("Id");
+
+ b.ToTable("syntaxes");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
+ {
+ b.HasOne("FilterLists.Data.Entities.License")
+ .WithMany("FilterLists")
+ .HasForeignKey("LicenseId");
+
+ b.HasOne("FilterLists.Data.Entities.Maintainer")
+ .WithMany("FilterLists")
+ .HasForeignKey("MaintainerId");
+
+ b.HasOne("FilterLists.Data.Entities.Syntax")
+ .WithMany("FilterLists")
+ .HasForeignKey("SyntaxId");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.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.FilterListRule", b =>
+ {
+ b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList")
+ .WithMany("FilterListRules")
+ .HasForeignKey("FilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.HasOne("FilterLists.Data.Entities.Rule", "Rule")
+ .WithMany("FilterListRules")
+ .HasForeignKey("RuleId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.FilterListSoftware", b =>
+ {
+ b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList")
+ .WithMany("FilterListSoftware")
+ .HasForeignKey("FilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.HasOne("FilterLists.Data.Entities.Software", "Software")
+ .WithMany("FilterListSoftware")
+ .HasForeignKey("SoftwareId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Fork", b =>
+ {
+ b.HasOne("FilterLists.Data.Entities.FilterList", "ForkFilterList")
+ .WithMany()
+ .HasForeignKey("ForkFilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList")
+ .WithMany()
+ .HasForeignKey("UpstreamFilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Merge", b =>
+ {
+ b.HasOne("FilterLists.Data.Entities.FilterList", "MergeFilterList")
+ .WithMany()
+ .HasForeignKey("MergeFilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+
+ b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList")
+ .WithMany()
+ .HasForeignKey("UpstreamFilterListId")
+ .OnDelete(DeleteBehavior.Cascade);
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.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);
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.cs b/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.cs
new file mode 100644
index 000000000..b2d9524eb
--- /dev/null
+++ b/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.cs
@@ -0,0 +1,102 @@
+using Microsoft.EntityFrameworkCore.Metadata;
+using Microsoft.EntityFrameworkCore.Migrations;
+using System;
+using System.Collections.Generic;
+
+namespace FilterLists.Api.Migrations
+{
+ public partial class addSyntaxentity : Migration
+ {
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn(
+ name: "SyntaxId",
+ table: "filterlists",
+ type: "int",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "syntaxes",
+ columns: table => new
+ {
+ Id = table.Column(type: "int", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ DefinitionUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true),
+ ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false),
+ Name = table.Column(type: "varchar(126)", maxLength: 126, nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_syntaxes", x => x.Id);
+ });
+
+ migrationBuilder.CreateTable(
+ name: "software_syntaxes",
+ columns: table => new
+ {
+ SoftwareId = table.Column(type: "int", nullable: false),
+ SyntaxId = table.Column(type: "int", nullable: false),
+ CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false)
+ .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
+ ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_software_syntaxes", x => new { x.SoftwareId, x.SyntaxId });
+ table.ForeignKey(
+ name: "FK_software_syntaxes_software_SoftwareId",
+ column: x => x.SoftwareId,
+ principalTable: "software",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ table.ForeignKey(
+ name: "FK_software_syntaxes_syntaxes_SyntaxId",
+ column: x => x.SyntaxId,
+ principalTable: "syntaxes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_filterlists_SyntaxId",
+ table: "filterlists",
+ column: "SyntaxId");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_software_syntaxes_SyntaxId",
+ table: "software_syntaxes",
+ column: "SyntaxId");
+
+ migrationBuilder.AddForeignKey(
+ name: "FK_filterlists_syntaxes_SyntaxId",
+ table: "filterlists",
+ column: "SyntaxId",
+ principalTable: "syntaxes",
+ principalColumn: "Id",
+ onDelete: ReferentialAction.Restrict);
+ }
+
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "FK_filterlists_syntaxes_SyntaxId",
+ table: "filterlists");
+
+ migrationBuilder.DropTable(
+ name: "software_syntaxes");
+
+ migrationBuilder.DropTable(
+ name: "syntaxes");
+
+ migrationBuilder.DropIndex(
+ name: "IX_filterlists_SyntaxId",
+ table: "filterlists");
+
+ migrationBuilder.DropColumn(
+ name: "SyntaxId",
+ table: "filterlists");
+ }
+ }
+}
diff --git a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs
index 60abb94c9..8013392d4 100644
--- a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs
+++ b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs
@@ -67,6 +67,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.Property("SubmissionUrl")
.HasMaxLength(2083);
+ b.Property("SyntaxId");
+
b.Property("ViewUrl")
.HasMaxLength(2083);
@@ -76,6 +78,8 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasIndex("MaintainerId");
+ b.HasIndex("SyntaxId");
+
b.ToTable("filterlists");
});
@@ -331,6 +335,52 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("software");
});
+ modelBuilder.Entity("FilterLists.Data.Entities.SoftwareSyntax", b =>
+ {
+ b.Property("SoftwareId");
+
+ b.Property("SyntaxId");
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.HasKey("SoftwareId", "SyntaxId");
+
+ b.HasIndex("SyntaxId");
+
+ b.ToTable("software_syntaxes");
+ });
+
+ modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd();
+
+ b.Property("CreatedDateUtc")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("DefinitionUrl")
+ .HasMaxLength(2083);
+
+ b.Property("ModifiedDateUtc")
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("TIMESTAMP");
+
+ b.Property("Name")
+ .IsRequired()
+ .HasMaxLength(126);
+
+ b.HasKey("Id");
+
+ b.ToTable("syntaxes");
+ });
+
modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
{
b.HasOne("FilterLists.Data.Entities.License")
@@ -340,6 +390,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.HasOne("FilterLists.Data.Entities.Maintainer")
.WithMany("FilterLists")
.HasForeignKey("MaintainerId");
+
+ b.HasOne("FilterLists.Data.Entities.Syntax")
+ .WithMany("FilterLists")
+ .HasForeignKey("SyntaxId");
});
modelBuilder.Entity("FilterLists.Data.Entities.FilterListLanguage", b =>
@@ -406,6 +460,19 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasForeignKey("UpstreamFilterListId")
.OnDelete(DeleteBehavior.Cascade);
});
+
+ modelBuilder.Entity("FilterLists.Data.Entities.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);
+ });
#pragma warning restore 612, 618
}
}
diff --git a/src/FilterLists.Data/Entities/FilterList.cs b/src/FilterLists.Data/Entities/FilterList.cs
index 7b6e7ee72..8759f6d52 100644
--- a/src/FilterLists.Data/Entities/FilterList.cs
+++ b/src/FilterLists.Data/Entities/FilterList.cs
@@ -20,6 +20,7 @@ public class FilterList : BaseEntity
public int? MaintainerId { get; set; }
public string Name { get; set; }
public string SubmissionUrl { get; set; }
+ public int? SyntaxId { get; set; }
public string ViewUrl { get; set; }
}
}
\ No newline at end of file
diff --git a/src/FilterLists.Data/Entities/Software.cs b/src/FilterLists.Data/Entities/Software.cs
index 48b36f6c7..32f719047 100644
--- a/src/FilterLists.Data/Entities/Software.cs
+++ b/src/FilterLists.Data/Entities/Software.cs
@@ -8,5 +8,6 @@ public class Software : BaseEntity
public string HomeUrl { get; set; }
public ICollection FilterListSoftware { get; set; }
public string Name { get; set; }
+ public ICollection SoftwareSyntaxes { get; set; }
}
}
\ No newline at end of file
diff --git a/src/FilterLists.Data/Entities/SoftwareSyntax.cs b/src/FilterLists.Data/Entities/SoftwareSyntax.cs
new file mode 100644
index 000000000..e9210cca3
--- /dev/null
+++ b/src/FilterLists.Data/Entities/SoftwareSyntax.cs
@@ -0,0 +1,11 @@
+namespace FilterLists.Data.Entities
+{
+ public class SoftwareSyntax : BaseEntity
+ {
+ public int SoftwareId { get; set; }
+ public Software Software { get; set; }
+
+ public int SyntaxId { get; set; }
+ public Syntax Syntax { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/FilterLists.Data/Entities/Syntax.cs b/src/FilterLists.Data/Entities/Syntax.cs
new file mode 100644
index 000000000..913cf8dca
--- /dev/null
+++ b/src/FilterLists.Data/Entities/Syntax.cs
@@ -0,0 +1,12 @@
+using System.Collections.Generic;
+
+namespace FilterLists.Data.Entities
+{
+ public class Syntax : BaseEntity
+ {
+ public string DefinitionUrl { get; set; }
+ public ICollection FilterLists { get; set; }
+ public string Name { get; set; }
+ public ICollection SoftwareSyntaxes { get; set; }
+ }
+}
\ No newline at end of file
diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SoftwareSyntaxTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareSyntaxTypeConfiguration.cs
new file mode 100644
index 000000000..8e42ab2d0
--- /dev/null
+++ b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareSyntaxTypeConfiguration.cs
@@ -0,0 +1,17 @@
+using FilterLists.Data.Entities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace FilterLists.Data.EntityTypeConfigurations
+{
+ public class SoftwareSyntaxTypeConfiguration : BaseEntityTypeConfiguration
+ {
+ public override void Configure(EntityTypeBuilder entityTypeBuilder)
+ {
+ entityTypeBuilder.ToTable("software_syntaxes");
+ entityTypeBuilder.HasKey(x => new {x.SoftwareId, x.SyntaxId});
+ entityTypeBuilder.Ignore(x => x.Id);
+ base.Configure(entityTypeBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs
new file mode 100644
index 000000000..f246c7dfd
--- /dev/null
+++ b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs
@@ -0,0 +1,20 @@
+using FilterLists.Data.Entities;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace FilterLists.Data.EntityTypeConfigurations
+{
+ public class SyntaxTypeConfiguration : BaseEntityTypeConfiguration
+ {
+ public override void Configure(EntityTypeBuilder entityTypeBuilder)
+ {
+ entityTypeBuilder.ToTable("syntaxes");
+ entityTypeBuilder.Property(x => x.DefinitionUrl)
+ .HasMaxLength(2083);
+ entityTypeBuilder.Property(x => x.Name)
+ .IsRequired()
+ .HasMaxLength(126);
+ base.Configure(entityTypeBuilder);
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/FilterLists.Data/FilterListsDbContext.cs b/src/FilterLists.Data/FilterListsDbContext.cs
index b2d1753f0..cc9e64e3e 100644
--- a/src/FilterLists.Data/FilterListsDbContext.cs
+++ b/src/FilterLists.Data/FilterListsDbContext.cs
@@ -17,6 +17,7 @@ public FilterListsDbContext(DbContextOptions options)
public DbSet Maintainers { get; set; }
public DbSet Rules { get; set; }
public DbSet Software { get; set; }
+ public DbSet Syntaxes { get; set; }
protected override void OnModelCreating(ModelBuilder modelBuilder)
{
@@ -26,12 +27,14 @@ protected override void OnModelCreating(ModelBuilder modelBuilder)
modelBuilder.ApplyConfiguration(new MaintainerTypeConfiguration());
modelBuilder.ApplyConfiguration(new RuleTypeConfiguration());
modelBuilder.ApplyConfiguration(new SoftwareTypeConfiguration());
+ modelBuilder.ApplyConfiguration(new SyntaxTypeConfiguration());
modelBuilder.ApplyConfiguration(new FilterListLanguageTypeConfiguration());
modelBuilder.ApplyConfiguration(new FilterListRuleTypeConfiguration());
modelBuilder.ApplyConfiguration(new FilterListSoftwareTypeConfiguration());
modelBuilder.ApplyConfiguration(new ForkTypeConfiguration());
modelBuilder.ApplyConfiguration(new MergeTypeConfiguration());
+ modelBuilder.ApplyConfiguration(new SoftwareSyntaxTypeConfiguration());
base.OnModelCreating(modelBuilder);
}