mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add Snapshot entity
This commit is contained in:
parent
e6d378286b
commit
1ee069b8a3
4 changed files with 33 additions and 3 deletions
|
|
@ -11,14 +11,15 @@ public class FilterList : BaseEntity
|
|||
public DateTime? DiscontinuedDate { get; set; }
|
||||
public string DonateUrl { get; set; }
|
||||
public string EmailAddress { get; set; }
|
||||
public string ForumUrl { get; set; }
|
||||
public string HomeUrl { get; set; }
|
||||
public string IssuesUrl { get; set; }
|
||||
public ICollection<FilterListLanguage> FilterListLanguages { get; set; }
|
||||
public ICollection<FilterListMaintainer> FilterListMaintainers { get; set; }
|
||||
public ICollection<FilterListRule> FilterListRules { get; set; }
|
||||
public string ForumUrl { get; set; }
|
||||
public string HomeUrl { get; set; }
|
||||
public string IssuesUrl { get; set; }
|
||||
public int? LicenseId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public ICollection<Snapshot> Snapshots { get; set; }
|
||||
public string SubmissionUrl { get; set; }
|
||||
public int? SyntaxId { get; set; }
|
||||
public string ViewUrl { get; set; }
|
||||
|
|
|
|||
8
src/FilterLists.Data/Entities/Snapshot.cs
Normal file
8
src/FilterLists.Data/Entities/Snapshot.cs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
namespace FilterLists.Data.Entities
|
||||
{
|
||||
public class Snapshot : BaseEntity
|
||||
{
|
||||
public string Content { get; set; }
|
||||
public int FilterListId { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,19 @@
|
|||
using FilterLists.Data.Entities;
|
||||
using Microsoft.EntityFrameworkCore;
|
||||
using Microsoft.EntityFrameworkCore.Metadata.Builders;
|
||||
|
||||
namespace FilterLists.Data.EntityTypeConfigurations
|
||||
{
|
||||
public class SnapshotTypeConfiguration : BaseEntityTypeConfiguration<Snapshot>
|
||||
{
|
||||
public override void Configure(EntityTypeBuilder<Snapshot> entityTypeBuilder)
|
||||
{
|
||||
entityTypeBuilder.ToTable("snapshots");
|
||||
entityTypeBuilder.Property(x => x.Content)
|
||||
.HasColumnType("TEXT")
|
||||
.IsRequired();
|
||||
entityTypeBuilder.Ignore(x => x.ModifiedDateUtc);
|
||||
base.Configure(entityTypeBuilder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -27,6 +27,7 @@ private static void ApplyConfigurationsEntities(ModelBuilder modelBuilder)
|
|||
modelBuilder.ApplyConfiguration(new LicenseTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new MaintainerTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new RuleTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new SnapshotTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new SoftwareTypeConfiguration());
|
||||
modelBuilder.ApplyConfiguration(new SyntaxTypeConfiguration());
|
||||
}
|
||||
|
|
@ -48,6 +49,7 @@ private static void ApplyConfigurationsJunctions(ModelBuilder modelBuilder)
|
|||
public DbSet<License> Licenses { get; set; }
|
||||
public DbSet<Maintainer> Maintainers { get; set; }
|
||||
public DbSet<Rule> Rules { get; set; }
|
||||
public DbSet<Snapshot> Snapshots { get; set; }
|
||||
public DbSet<Software> Software { get; set; }
|
||||
public DbSet<Syntax> Syntaxes { get; set; }
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue