mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
add Submission URL, modify License bool names
This commit is contained in:
parent
1dd1e1dee3
commit
567f283b54
6 changed files with 421 additions and 4 deletions
343
src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.Designer.cs
generated
Normal file
343
src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.Designer.cs
generated
Normal file
|
|
@ -0,0 +1,343 @@
|
|||
// <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("20171101015403_add Submission URL, modify License bool names")]
|
||||
partial class addSubmissionURLmodifyLicenseboolnames
|
||||
{
|
||||
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<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Description")
|
||||
.HasMaxLength(4096);
|
||||
|
||||
b.Property<string>("DescriptionSourceUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("DonateUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<string>("ForumUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("IssuesUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<int?>("LicenseId");
|
||||
|
||||
b.Property<int?>("MaintainerId");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<string>("SubmissionUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("ViewUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.HasIndex("LicenseId");
|
||||
|
||||
b.HasIndex("MaintainerId");
|
||||
|
||||
b.ToTable("filterlists");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.FilterListLanguage", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("LanguageId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "LanguageId");
|
||||
|
||||
b.HasIndex("LanguageId");
|
||||
|
||||
b.ToTable("filterlists_languages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.FilterListRule", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("RuleId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "RuleId");
|
||||
|
||||
b.HasIndex("RuleId");
|
||||
|
||||
b.ToTable("filterlists_rules");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.FilterListSoftware", b =>
|
||||
{
|
||||
b.Property<int>("FilterListId");
|
||||
|
||||
b.Property<int>("SoftwareId");
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.HasKey("FilterListId", "SoftwareId");
|
||||
|
||||
b.HasIndex("SoftwareId");
|
||||
|
||||
b.ToTable("filterlists_software");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Language", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Iso6391")
|
||||
.HasMaxLength(2);
|
||||
|
||||
b.Property<string>("Iso6392")
|
||||
.HasMaxLength(3);
|
||||
|
||||
b.Property<string>("Iso6392B")
|
||||
.HasMaxLength(3);
|
||||
|
||||
b.Property<string>("Iso6392T")
|
||||
.HasMaxLength(3);
|
||||
|
||||
b.Property<string>("Iso6393")
|
||||
.HasMaxLength(3);
|
||||
|
||||
b.Property<string>("LocalName")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("languages");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.License", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("DescriptionUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
|
||||
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();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("EmailAddress")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<string>("TwitterHandle")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("maintainers");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Rule", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Raw")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("rules");
|
||||
});
|
||||
|
||||
modelBuilder.Entity("FilterLists.Data.Entities.Software", b =>
|
||||
{
|
||||
b.Property<int>("Id")
|
||||
.ValueGeneratedOnAdd();
|
||||
|
||||
b.Property<DateTime>("CreatedDateUtc")
|
||||
.ValueGeneratedOnAdd()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("DownloadUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("HomeUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<DateTime>("ModifiedDateUtc")
|
||||
.ValueGeneratedOnAddOrUpdate()
|
||||
.HasColumnType("TIMESTAMP");
|
||||
|
||||
b.Property<string>("Name")
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
b.ToTable("software");
|
||||
});
|
||||
|
||||
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");
|
||||
});
|
||||
|
||||
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);
|
||||
});
|
||||
#pragma warning restore 612, 618
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,68 @@
|
|||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace FilterLists.Api.Migrations
|
||||
{
|
||||
public partial class addSubmissionURLmodifyLicenseboolnames : Migration
|
||||
{
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PermissiveRedistribution",
|
||||
table: "licenses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PermissiveUsage",
|
||||
table: "licenses");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "PermissiveAdaptation",
|
||||
table: "licenses",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "PermissiveCommercial",
|
||||
table: "licenses",
|
||||
type: "bit",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<string>(
|
||||
name: "SubmissionUrl",
|
||||
table: "filterlists",
|
||||
type: "varchar(2083)",
|
||||
maxLength: 2083,
|
||||
nullable: true);
|
||||
}
|
||||
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PermissiveAdaptation",
|
||||
table: "licenses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "PermissiveCommercial",
|
||||
table: "licenses");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "SubmissionUrl",
|
||||
table: "filterlists");
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "PermissiveRedistribution",
|
||||
table: "licenses",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
|
||||
migrationBuilder.AddColumn<bool>(
|
||||
name: "PermissiveUsage",
|
||||
table: "licenses",
|
||||
nullable: false,
|
||||
defaultValue: false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -62,6 +62,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
|
|||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<string>("SubmissionUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
b.Property<string>("ViewUrl")
|
||||
.HasMaxLength(2083);
|
||||
|
||||
|
|
@ -196,9 +199,9 @@ protected override void BuildModel(ModelBuilder modelBuilder)
|
|||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
|
||||
b.Property<bool>("PermissiveRedistribution");
|
||||
b.Property<bool>("PermissiveAdaptation");
|
||||
|
||||
b.Property<bool>("PermissiveUsage");
|
||||
b.Property<bool>("PermissiveCommercial");
|
||||
|
||||
b.HasKey("Id");
|
||||
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public class FilterList : BaseEntity
|
|||
public int? LicenseId { get; set; }
|
||||
public int? MaintainerId { get; set; }
|
||||
public string Name { get; set; }
|
||||
public string SubmissionUrl { get; set; }
|
||||
public string ViewUrl { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -7,7 +7,7 @@ public class License : BaseEntity
|
|||
public string DescriptionUrl { get; set; }
|
||||
public ICollection<FilterList> FilterLists { get; set; }
|
||||
public string Name { get; set; }
|
||||
public bool PermissiveRedistribution { get; set; }
|
||||
public bool PermissiveUsage { get; set; }
|
||||
public bool PermissiveAdaptation { get; set; }
|
||||
public bool PermissiveCommercial { get; set; }
|
||||
}
|
||||
}
|
||||
|
|
@ -26,6 +26,8 @@ public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
|
|||
entityTypeBuilder.Property(b => b.Name)
|
||||
.IsRequired()
|
||||
.HasMaxLength(126);
|
||||
entityTypeBuilder.Property(b => b.SubmissionUrl)
|
||||
.HasMaxLength(2083);
|
||||
entityTypeBuilder.Property(b => b.ViewUrl)
|
||||
.HasMaxLength(2083);
|
||||
base.Configure(entityTypeBuilder);
|
||||
|
|
|
|||
Loading…
Reference in a new issue