mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
extract base entity types
This commit is contained in:
parent
9fbd204e0e
commit
f7d6e3aff1
26 changed files with 564 additions and 124 deletions
455
src/FilterLists.Api/Migrations/20180128204000_ExtractBaseEntityTypes.Designer.cs
generated
Normal file
455
src/FilterLists.Api/Migrations/20180128204000_ExtractBaseEntityTypes.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,455 @@
|
|||
// <auto-generated />
|
||||
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("20180128204000_ExtractBaseEntityTypes")]
|
||||
partial class ExtractBaseEntityTypes
|
||||
{
|
||||
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
||||
{
|
||||
#pragma warning disable 612, 618
|
||||
modelBuilder
|
||||
.HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn)
|
||||
.HasAnnotation("ProductVersion", "2.0.1-rtm-125");
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("DescriptionSourceUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime?>("DiscontinuedDate");
|
||||
|
||||
b.Property<string>("DonateUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
||||
b.Property<string>("ForumUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("IssuesUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("LicenseId");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126) NOT NULL");
|
||||
|
||||
b.Property<DateTime?>("ScrapedDateUtc");
|
||||
|
||||
b.Property<string>("SubmissionUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<int?>("SyntaxId");
|
||||
|
||||
b.Property<DateTime?>("UpdatedDateUtc");
|
||||
|
||||
b.Property<string>("ViewUrl")
|
||||
.HasColumnType("TEXT NOT NULL");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LicenseId");
|
||||
|
||||
b.HasIndex("SyntaxId");
|
||||
|
||||
b.ToTable("filterlists");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("LanguageId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "LanguageId");
|
||||
|
||||
b.HasIndex("LanguageId");
|
||||
|
||||
b.ToTable("filterlists_languages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("MaintainerId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "MaintainerId");
|
||||
|
||||
b.HasIndex("MaintainerId");
|
||||
|
||||
b.ToTable("filterlists_maintainers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListRule", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("RuleId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "RuleId");
|
||||
|
||||
b.HasIndex("RuleId");
|
||||
|
||||
b.ToTable("filterlists_rules");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b =>
|
||||
{
|
||||
b.Property<int>("ForkFilterListId");
|
||||
|
||||
b.Property<int>("UpstreamFilterListId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("ForkFilterListId", "UpstreamFilterListId");
|
||||
|
||||
b.HasIndex("UpstreamFilterListId");
|
||||
|
||||
b.ToTable("forks");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b =>
|
||||
{
|
||||
b.Property<int>("MergeFilterListId");
|
||||
|
||||
b.Property<int>("UpstreamFilterListId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("MergeFilterListId", "UpstreamFilterListId");
|
||||
|
||||
b.HasIndex("UpstreamFilterListId");
|
||||
|
||||
b.ToTable("merges");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b =>
|
||||
{
|
||||
b.Property<int>("SoftwareId");
|
||||
|
||||
b.Property<int>("SyntaxId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("SoftwareId", "SyntaxId");
|
||||
|
||||
b.HasIndex("SyntaxId");
|
||||
|
||||
b.ToTable("software_syntaxes");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Language", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Iso6391")
|
||||
.HasColumnType("NVARCHAR(2)");
|
||||
|
||||
b.Property<string>("Iso6392")
|
||||
.HasColumnType("NVARCHAR(3)");
|
||||
|
||||
b.Property<string>("Iso6392B")
|
||||
.HasColumnType("NVARCHAR(3)");
|
||||
|
||||
b.Property<string>("Iso6392T")
|
||||
.HasColumnType("NVARCHAR(3)");
|
||||
|
||||
b.Property<string>("Iso6393")
|
||||
.HasColumnType("NVARCHAR(3)");
|
||||
|
||||
b.Property<string>("LocalName")
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("languages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.License", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("DescriptionUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126) NOT NULL");
|
||||
|
||||
b.Property<bool>("PermissiveAdaptation");
|
||||
|
||||
b.Property<bool>("PermissiveCommercial");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("licenses");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126) NOT NULL");
|
||||
|
||||
b.Property<string>("TwitterHandle")
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("maintainers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Rule", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("BIGINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Raw")
|
||||
.HasColumnType("NVARCHAR(2083) NOT NULL");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("rules");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Software", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("DownloadUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126) NOT NULL");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("software");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("DefinitionUrl")
|
||||
.HasColumnType("TEXT");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasColumnType("NVARCHAR(126) NOT NULL");
|
||||
|
||||
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.Syntax")
|
||||
.WithMany("FilterLists")
|
||||
.HasForeignKey("SyntaxId");
|
||||
});
|
||||
|
||||
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.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.Junctions.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.Junctions.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.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);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,25 @@
|
|||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
namespace FilterLists.Api.Migrations
|
||||
{
|
||||
public partial class ExtractBaseEntityTypes : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<DateTime>(
|
||||
"ModifiedDateUtc",
|
||||
"rules",
|
||||
"TIMESTAMP",
|
||||
nullable: false,
|
||||
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
"ModifiedDateUtc",
|
||||
"rules");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -293,6 +293,10 @@ protected override void BuildModel(ModelBuilder modelBuilder)
|
|||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Raw")
|
||||
.HasColumnType("NVARCHAR(2083) NOT NULL");
|
||||
|
||||
|
|
|
|||
11
src/FilterLists.Data/Entities/BaseEntity.cs
Normal file
11
src/FilterLists.Data/Entities/BaseEntity.cs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
using System;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -4,12 +4,8 @@
|
|||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class FilterList
|
||||
public class FilterList : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string Description { get; set; }
|
||||
public string DescriptionSourceUrl { get; set; }
|
||||
public DateTime? DiscontinuedDate { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Language
|
||||
public class Language : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string Iso6391 { get; set; }
|
||||
public string Iso6392 { get; set; }
|
||||
public string Iso6392B { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,14 +1,9 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class License
|
||||
public class License : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string DescriptionUrl { get; set; }
|
||||
public ICollection<FilterList> FilterLists { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Maintainer
|
||||
public class Maintainer : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string EmailAddress { get; set; }
|
||||
public string HomeUrl { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,14 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Rule
|
||||
public class Rule : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
|
||||
public string Raw { get; set; }
|
||||
|
||||
public ICollection<FilterListRule> FilterListRules { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Software
|
||||
public class Software : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string DownloadUrl { get; set; }
|
||||
public string HomeUrl { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -1,15 +1,10 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using FilterLists.Data.Entities.Junctions;
|
||||
|
||||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Syntax
|
||||
public class Syntax : BaseEntity
|
||||
{
|
||||
public int Id { get; set; }
|
||||
public DateTime CreatedDateUtc { get; set; }
|
||||
public DateTime ModifiedDateUtc { get; set; }
|
||||
|
||||
public string DefinitionUrl { get; set; }
|
||||
public ICollection<FilterList> FilterLists { get; set; }
|
||||
public string Name { get; set; }
|
||||
|
|
|
|||
|
|
@ -0,0 +1,21 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class BaseEntityTypeConfiguration<TEntity> : IEntityTypeConfiguration<TEntity> where TEntity : BaseEntity
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<TEntity> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class FilterListTypeConfiguration : IEntityTypeConfiguration<FilterList>
|
||||
public class FilterListTypeConfiguration : BaseEntityTypeConfiguration<FilterList>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("filterlists");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("filterlists");
|
||||
|
||||
entityTypeBuilder.Property(x => x.Description)
|
||||
.HasColumnType("TEXT");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class JunctionBaseTypeConfiguration<TJunction> : IEntityTypeConfiguration<TJunction>
|
||||
public class BaseJunctionTypeConfiguration<TJunction> : IEntityTypeConfiguration<TJunction>
|
||||
where TJunction : BaseJunction
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<TJunction> entityTypeBuilder)
|
||||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class FilterListLanguageTypeConfiguration : JunctionBaseTypeConfiguration<FilterListLanguage>
|
||||
public class FilterListLanguageTypeConfiguration : BaseJunctionTypeConfiguration<FilterListLanguage>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListLanguage> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class FilterListMaintainerTypeConfiguration : JunctionBaseTypeConfiguration<FilterListMaintainer>
|
||||
public class FilterListMaintainerTypeConfiguration : BaseJunctionTypeConfiguration<FilterListMaintainer>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListMaintainer> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class FilterListRuleTypeConfiguration : JunctionBaseTypeConfiguration<FilterListRule>
|
||||
public class FilterListRuleTypeConfiguration : BaseJunctionTypeConfiguration<FilterListRule>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<FilterListRule> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class ForkTypeConfiguration : JunctionBaseTypeConfiguration<Fork>
|
||||
public class ForkTypeConfiguration : BaseJunctionTypeConfiguration<Fork>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Fork> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class MergeTypeConfiguration : JunctionBaseTypeConfiguration<Merge>
|
||||
public class MergeTypeConfiguration : BaseJunctionTypeConfiguration<Merge>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Merge> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations.Junctions
|
||||
{
|
||||
public class SoftwareSyntaxTypeConfiguration : JunctionBaseTypeConfiguration<SoftwareSyntax>
|
||||
public class SoftwareSyntaxTypeConfiguration : BaseJunctionTypeConfiguration<SoftwareSyntax>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<SoftwareSyntax> entityTypeBuilder)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class LanguageTypeConfiguration : IEntityTypeConfiguration<Language>
|
||||
public class LanguageTypeConfiguration : BaseEntityTypeConfiguration<Language>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Language> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Language> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("languages");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("languages");
|
||||
|
||||
entityTypeBuilder.Property(x => x.Iso6391)
|
||||
.HasColumnType("NVARCHAR(2)");
|
||||
|
|
|
|||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class LicenseTypeConfiguration : IEntityTypeConfiguration<License>
|
||||
public class LicenseTypeConfiguration : BaseEntityTypeConfiguration<License>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<License> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<License> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("licenses");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("licenses");
|
||||
|
||||
entityTypeBuilder.Property(x => x.DescriptionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
|
|
|
|||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class MaintainerTypeConfiguration : IEntityTypeConfiguration<Maintainer>
|
||||
public class MaintainerTypeConfiguration : BaseEntityTypeConfiguration<Maintainer>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Maintainer> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Maintainer> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("maintainers");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("maintainers");
|
||||
|
||||
entityTypeBuilder.Property(x => x.EmailAddress)
|
||||
.HasColumnType("NVARCHAR(126)");
|
||||
|
|
|
|||
|
|
@ -4,17 +4,16 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class RuleTypeConfiguration : IEntityTypeConfiguration<Rule>
|
||||
public class RuleTypeConfiguration : BaseEntityTypeConfiguration<Rule>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Rule> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Rule> entityTypeBuilder)
|
||||
{
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.ToTable("rules");
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("BIGINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
entityTypeBuilder.Property(x => x.Raw)
|
||||
.HasColumnType("NVARCHAR(2083) NOT NULL");
|
||||
|
|
|
|||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class SoftwareTypeConfiguration : IEntityTypeConfiguration<Software>
|
||||
public class SoftwareTypeConfiguration : BaseEntityTypeConfiguration<Software>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Software> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Software> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("software");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("software");
|
||||
|
||||
entityTypeBuilder.Property(x => x.DownloadUrl)
|
||||
.HasColumnType("TEXT");
|
||||
|
|
|
|||
|
|
@ -4,20 +4,13 @@
|
|||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class SyntaxTypeConfiguration : IEntityTypeConfiguration<Syntax>
|
||||
public class SyntaxTypeConfiguration : BaseEntityTypeConfiguration<Syntax>
|
||||
{
|
||||
public void Configure(EntityTypeBuilder<Syntax> entityTypeBuilder)
|
||||
public override void Configure(EntityTypeBuilder<Syntax> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("syntaxes");
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
||||
entityTypeBuilder.Property(x => x.Id)
|
||||
.HasColumnType("SMALLINT UNSIGNED");
|
||||
entityTypeBuilder.Property(x => x.CreatedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAdd();
|
||||
entityTypeBuilder.Property(x => x.ModifiedDateUtc)
|
||||
.HasColumnType("TIMESTAMP")
|
||||
.ValueGeneratedOnAddOrUpdate();
|
||||
entityTypeBuilder.ToTable("syntaxes");
|
||||
|
||||
entityTypeBuilder.Property(x => x.DefinitionUrl)
|
||||
.HasColumnType("TEXT");
|
||||
|
|
|
|||
Loading…
Reference in a new issue