fix(directory-data): 🐛🚧 clear migrations

This commit is contained in:
Collin M. Barrett 2021-05-09 17:49:38 -05:00
parent 05ac335660
commit 69b333702f
10 changed files with 1 additions and 421983 deletions

View file

@ -1,6 +1,5 @@
using System;
using System.Threading.Tasks;
using FilterLists.Directory.Infrastructure.Migrations.Migrations;
using FilterLists.Directory.Infrastructure.Persistence.Queries.Context;
using Microsoft.EntityFrameworkCore;
using Xunit;
@ -17,7 +16,7 @@ public async Task Migrate_DoesNotThrowException()
var connString = Environment.GetEnvironmentVariable("ConnectionStrings__DirectoryConnection") ??
throw new Exception();
var options = new DbContextOptionsBuilder<QueryDbContext>()
.UseNpgsql(connString, m => m.MigrationsAssembly(typeof(Initial).Assembly.GetName().Name))
.UseNpgsql(connString, m => m.MigrationsAssembly("FilterLists.Directory.Infrastructure.Migrations.Migrations"))
.EnableSensitiveDataLogging()
.Options;
await using var context = new QueryDbContext(options);

View file

@ -1,596 +0,0 @@
// <auto-generated />
using System;
using FilterLists.Directory.Infrastructure.Persistence.Queries.Context;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
[DbContext(typeof(QueryDbContext))]
[Migration("20210509213502_Initial")]
partial class Initial
{
protected override void BuildTargetModel(ModelBuilder modelBuilder)
{
#pragma warning disable 612, 618
modelBuilder
.HasAnnotation("Relational:MaxIdentifierLength", 63)
.HasAnnotation("ProductVersion", "5.0.5")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Dependent", b =>
{
b.Property<int>("DependencyFilterListId")
.HasColumnType("integer");
b.Property<int>("DependentFilterListId")
.HasColumnType("integer");
b.HasKey("DependencyFilterListId", "DependentFilterListId");
b.HasIndex("DependentFilterListId");
b.ToTable("Dependents");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("ChatUrl")
.HasColumnType("text");
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("DonateUrl")
.HasColumnType("text");
b.Property<string>("EmailAddress")
.HasColumnType("text");
b.Property<string>("ForumUrl")
.HasColumnType("text");
b.Property<string>("HomeUrl")
.HasColumnType("text");
b.Property<string>("IssuesUrl")
.HasColumnType("text");
b.Property<int?>("LicenseId")
.HasColumnType("integer");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("OnionUrl")
.HasColumnType("text");
b.Property<string>("PolicyUrl")
.HasColumnType("text");
b.Property<string>("SubmissionUrl")
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("LicenseId");
b.ToTable("FilterLists");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListLanguage", b =>
{
b.Property<int>("FilterListId")
.HasColumnType("integer");
b.Property<string>("Iso6391")
.HasColumnType("character(2)");
b.HasKey("FilterListId", "Iso6391");
b.HasIndex("Iso6391");
b.ToTable("FilterListLanguages");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListMaintainer", b =>
{
b.Property<int>("FilterListId")
.HasColumnType("integer");
b.Property<int>("MaintainerId")
.HasColumnType("integer");
b.HasKey("FilterListId", "MaintainerId");
b.HasIndex("MaintainerId");
b.ToTable("FilterListMaintainers");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListSyntax", b =>
{
b.Property<int>("FilterListId")
.HasColumnType("integer");
b.Property<int>("SyntaxId")
.HasColumnType("integer");
b.HasKey("FilterListId", "SyntaxId");
b.HasIndex("SyntaxId");
b.ToTable("FilterListSyntaxes");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListTag", b =>
{
b.Property<int>("FilterListId")
.HasColumnType("integer");
b.Property<int>("TagId")
.HasColumnType("integer");
b.HasKey("FilterListId", "TagId");
b.HasIndex("TagId");
b.ToTable("FilterListTags");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListViewUrl", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<int>("FilterListId")
.HasColumnType("integer");
b.Property<short>("Primariness")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b.Property<short>("SegmentNumber")
.ValueGeneratedOnAdd()
.HasColumnType("smallint")
.HasDefaultValue((short)1);
b.Property<string>("Url")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.HasIndex("FilterListId", "SegmentNumber", "Primariness")
.IsUnique();
b.ToTable("FilterListViewUrls");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Fork", b =>
{
b.Property<int>("UpstreamFilterListId")
.HasColumnType("integer");
b.Property<int>("ForkFilterListId")
.HasColumnType("integer");
b.HasKey("UpstreamFilterListId", "ForkFilterListId");
b.HasIndex("ForkFilterListId");
b.ToTable("Forks");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
{
b.Property<string>("Iso6391")
.HasMaxLength(2)
.HasColumnType("character(2)")
.IsFixedLength(true);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Iso6391");
b.ToTable("Languages");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("PermitsCommercialUse")
.HasColumnType("boolean");
b.Property<bool>("PermitsDistribution")
.HasColumnType("boolean");
b.Property<bool>("PermitsModification")
.HasColumnType("boolean");
b.Property<string>("Url")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Licenses");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("EmailAddress")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("TwitterHandle")
.HasColumnType("text");
b.Property<string>("Url")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Maintainers");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Merge", b =>
{
b.Property<int>("IncludedInFilterListId")
.HasColumnType("integer");
b.Property<int>("IncludesFilterListId")
.HasColumnType("integer");
b.HasKey("IncludedInFilterListId", "IncludesFilterListId");
b.HasIndex("IncludesFilterListId");
b.ToTable("Merges");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("DownloadUrl")
.HasColumnType("text");
b.Property<string>("HomeUrl")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<bool>("SupportsAbpUrlScheme")
.HasColumnType("boolean");
b.HasKey("Id");
b.ToTable("Software");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.SoftwareSyntax", b =>
{
b.Property<int>("SoftwareId")
.HasColumnType("integer");
b.Property<int>("SyntaxId")
.HasColumnType("integer");
b.HasKey("SoftwareId", "SyntaxId");
b.HasIndex("SyntaxId");
b.ToTable("SoftwareSyntaxes");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.Property<string>("Url")
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Syntaxes");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("integer")
.HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn);
b.Property<string>("Description")
.HasColumnType("text");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("text");
b.HasKey("Id");
b.ToTable("Tags");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Dependent", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "DependencyFilterList")
.WithMany("DependentFilterLists")
.HasForeignKey("DependencyFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "DependentFilterList")
.WithMany("DependencyFilterLists")
.HasForeignKey("DependentFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("DependencyFilterList");
b.Navigation("DependentFilterList");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", "License")
.WithMany("FilterLists")
.HasForeignKey("LicenseId");
b.Navigation("License");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListLanguage", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
.WithMany("FilterListLanguages")
.HasForeignKey("FilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", "Language")
.WithMany("FilterListLanguages")
.HasForeignKey("Iso6391")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FilterList");
b.Navigation("Language");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListMaintainer", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
.WithMany("FilterListMaintainers")
.HasForeignKey("FilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", "Maintainer")
.WithMany("FilterListMaintainers")
.HasForeignKey("MaintainerId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FilterList");
b.Navigation("Maintainer");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListSyntax", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
.WithMany("FilterListSyntaxes")
.HasForeignKey("FilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", "Syntax")
.WithMany("FilterListSyntaxes")
.HasForeignKey("SyntaxId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FilterList");
b.Navigation("Syntax");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListTag", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
.WithMany("FilterListTags")
.HasForeignKey("FilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", "Tag")
.WithMany("FilterListTags")
.HasForeignKey("TagId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FilterList");
b.Navigation("Tag");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterListViewUrl", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "FilterList")
.WithMany("ViewUrls")
.HasForeignKey("FilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("FilterList");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Fork", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "ForkFilterList")
.WithMany("UpstreamFilterLists")
.HasForeignKey("ForkFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "UpstreamFilterList")
.WithMany("ForkFilterLists")
.HasForeignKey("UpstreamFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ForkFilterList");
b.Navigation("UpstreamFilterList");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Merge", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "IncludedInFilterList")
.WithMany("IncludesFilterLists")
.HasForeignKey("IncludedInFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", "IncludesFilterList")
.WithMany("IncludedInFilterLists")
.HasForeignKey("IncludesFilterListId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("IncludedInFilterList");
b.Navigation("IncludesFilterList");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.SoftwareSyntax", b =>
{
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", "Software")
.WithMany("SoftwareSyntaxes")
.HasForeignKey("SoftwareId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", "Syntax")
.WithMany("SoftwareSyntaxes")
.HasForeignKey("SyntaxId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("Software");
b.Navigation("Syntax");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.FilterList", b =>
{
b.Navigation("DependencyFilterLists");
b.Navigation("DependentFilterLists");
b.Navigation("FilterListLanguages");
b.Navigation("FilterListMaintainers");
b.Navigation("FilterListSyntaxes");
b.Navigation("FilterListTags");
b.Navigation("ForkFilterLists");
b.Navigation("IncludedInFilterLists");
b.Navigation("IncludesFilterLists");
b.Navigation("UpstreamFilterLists");
b.Navigation("ViewUrls");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Language", b =>
{
b.Navigation("FilterListLanguages");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.License", b =>
{
b.Navigation("FilterLists");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Maintainer", b =>
{
b.Navigation("FilterListMaintainers");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Software", b =>
{
b.Navigation("SoftwareSyntaxes");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Syntax", b =>
{
b.Navigation("FilterListSyntaxes");
b.Navigation("SoftwareSyntaxes");
});
modelBuilder.Entity("FilterLists.Directory.Infrastructure.Persistence.Queries.Entities.Tag", b =>
{
b.Navigation("FilterListTags");
});
#pragma warning restore 612, 618
}
}
}

View file

@ -1,448 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
public partial class Initial : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Languages",
columns: table => new
{
Iso6391 = table.Column<string>(type: "character(2)", fixedLength: true, maxLength: 2, nullable: false),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Languages", x => x.Iso6391);
});
migrationBuilder.CreateTable(
name: "Licenses",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Url = table.Column<string>(type: "text", nullable: true),
PermitsModification = table.Column<bool>(type: "boolean", nullable: false),
PermitsDistribution = table.Column<bool>(type: "boolean", nullable: false),
PermitsCommercialUse = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Licenses", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Maintainers",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Url = table.Column<string>(type: "text", nullable: true),
EmailAddress = table.Column<string>(type: "text", nullable: true),
TwitterHandle = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Maintainers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Software",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
HomeUrl = table.Column<string>(type: "text", nullable: true),
DownloadUrl = table.Column<string>(type: "text", nullable: true),
SupportsAbpUrlScheme = table.Column<bool>(type: "boolean", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Software", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Syntaxes",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
Url = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Syntaxes", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Tags",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_Tags", x => x.Id);
});
migrationBuilder.CreateTable(
name: "FilterLists",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Description = table.Column<string>(type: "text", nullable: true),
LicenseId = table.Column<int>(type: "integer", nullable: true),
HomeUrl = table.Column<string>(type: "text", nullable: true),
OnionUrl = table.Column<string>(type: "text", nullable: true),
PolicyUrl = table.Column<string>(type: "text", nullable: true),
SubmissionUrl = table.Column<string>(type: "text", nullable: true),
IssuesUrl = table.Column<string>(type: "text", nullable: true),
ForumUrl = table.Column<string>(type: "text", nullable: true),
ChatUrl = table.Column<string>(type: "text", nullable: true),
EmailAddress = table.Column<string>(type: "text", nullable: true),
DonateUrl = table.Column<string>(type: "text", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterLists", x => x.Id);
table.ForeignKey(
name: "FK_FilterLists_Licenses_LicenseId",
column: x => x.LicenseId,
principalTable: "Licenses",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
});
migrationBuilder.CreateTable(
name: "SoftwareSyntaxes",
columns: table => new
{
SoftwareId = table.Column<int>(type: "integer", nullable: false),
SyntaxId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_SoftwareSyntaxes", x => new { x.SoftwareId, x.SyntaxId });
table.ForeignKey(
name: "FK_SoftwareSyntaxes_Software_SoftwareId",
column: x => x.SoftwareId,
principalTable: "Software",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_SoftwareSyntaxes_Syntaxes_SyntaxId",
column: x => x.SyntaxId,
principalTable: "Syntaxes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Dependents",
columns: table => new
{
DependencyFilterListId = table.Column<int>(type: "integer", nullable: false),
DependentFilterListId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Dependents", x => new { x.DependencyFilterListId, x.DependentFilterListId });
table.ForeignKey(
name: "FK_Dependents_FilterLists_DependencyFilterListId",
column: x => x.DependencyFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Dependents_FilterLists_DependentFilterListId",
column: x => x.DependentFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FilterListLanguages",
columns: table => new
{
FilterListId = table.Column<int>(type: "integer", nullable: false),
Iso6391 = table.Column<string>(type: "character(2)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterListLanguages", x => new { x.FilterListId, x.Iso6391 });
table.ForeignKey(
name: "FK_FilterListLanguages_FilterLists_FilterListId",
column: x => x.FilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FilterListLanguages_Languages_Iso6391",
column: x => x.Iso6391,
principalTable: "Languages",
principalColumn: "Iso6391",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FilterListMaintainers",
columns: table => new
{
FilterListId = table.Column<int>(type: "integer", nullable: false),
MaintainerId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterListMaintainers", x => new { x.FilterListId, x.MaintainerId });
table.ForeignKey(
name: "FK_FilterListMaintainers_FilterLists_FilterListId",
column: x => x.FilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FilterListMaintainers_Maintainers_MaintainerId",
column: x => x.MaintainerId,
principalTable: "Maintainers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FilterListSyntaxes",
columns: table => new
{
FilterListId = table.Column<int>(type: "integer", nullable: false),
SyntaxId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterListSyntaxes", x => new { x.FilterListId, x.SyntaxId });
table.ForeignKey(
name: "FK_FilterListSyntaxes_FilterLists_FilterListId",
column: x => x.FilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FilterListSyntaxes_Syntaxes_SyntaxId",
column: x => x.SyntaxId,
principalTable: "Syntaxes",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FilterListTags",
columns: table => new
{
FilterListId = table.Column<int>(type: "integer", nullable: false),
TagId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterListTags", x => new { x.FilterListId, x.TagId });
table.ForeignKey(
name: "FK_FilterListTags_FilterLists_FilterListId",
column: x => x.FilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FilterListTags_Tags_TagId",
column: x => x.TagId,
principalTable: "Tags",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "FilterListViewUrls",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
FilterListId = table.Column<int>(type: "integer", nullable: false),
SegmentNumber = table.Column<short>(type: "smallint", nullable: false, defaultValue: (short)1),
Primariness = table.Column<short>(type: "smallint", nullable: false, defaultValue: (short)1),
Url = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FilterListViewUrls", x => x.Id);
table.ForeignKey(
name: "FK_FilterListViewUrls_FilterLists_FilterListId",
column: x => x.FilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Forks",
columns: table => new
{
UpstreamFilterListId = table.Column<int>(type: "integer", nullable: false),
ForkFilterListId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Forks", x => new { x.UpstreamFilterListId, x.ForkFilterListId });
table.ForeignKey(
name: "FK_Forks_FilterLists_ForkFilterListId",
column: x => x.ForkFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Forks_FilterLists_UpstreamFilterListId",
column: x => x.UpstreamFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "Merges",
columns: table => new
{
IncludedInFilterListId = table.Column<int>(type: "integer", nullable: false),
IncludesFilterListId = table.Column<int>(type: "integer", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Merges", x => new { x.IncludedInFilterListId, x.IncludesFilterListId });
table.ForeignKey(
name: "FK_Merges_FilterLists_IncludedInFilterListId",
column: x => x.IncludedInFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_Merges_FilterLists_IncludesFilterListId",
column: x => x.IncludesFilterListId,
principalTable: "FilterLists",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Dependents_DependentFilterListId",
table: "Dependents",
column: "DependentFilterListId");
migrationBuilder.CreateIndex(
name: "IX_FilterListLanguages_Iso6391",
table: "FilterListLanguages",
column: "Iso6391");
migrationBuilder.CreateIndex(
name: "IX_FilterListMaintainers_MaintainerId",
table: "FilterListMaintainers",
column: "MaintainerId");
migrationBuilder.CreateIndex(
name: "IX_FilterListSyntaxes_SyntaxId",
table: "FilterListSyntaxes",
column: "SyntaxId");
migrationBuilder.CreateIndex(
name: "IX_FilterListTags_TagId",
table: "FilterListTags",
column: "TagId");
migrationBuilder.CreateIndex(
name: "IX_FilterListViewUrls_FilterListId_SegmentNumber_Primariness",
table: "FilterListViewUrls",
columns: new[] { "FilterListId", "SegmentNumber", "Primariness" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_FilterLists_LicenseId",
table: "FilterLists",
column: "LicenseId");
migrationBuilder.CreateIndex(
name: "IX_Forks_ForkFilterListId",
table: "Forks",
column: "ForkFilterListId");
migrationBuilder.CreateIndex(
name: "IX_Merges_IncludesFilterListId",
table: "Merges",
column: "IncludesFilterListId");
migrationBuilder.CreateIndex(
name: "IX_SoftwareSyntaxes_SyntaxId",
table: "SoftwareSyntaxes",
column: "SyntaxId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Dependents");
migrationBuilder.DropTable(
name: "FilterListLanguages");
migrationBuilder.DropTable(
name: "FilterListMaintainers");
migrationBuilder.DropTable(
name: "FilterListSyntaxes");
migrationBuilder.DropTable(
name: "FilterListTags");
migrationBuilder.DropTable(
name: "FilterListViewUrls");
migrationBuilder.DropTable(
name: "Forks");
migrationBuilder.DropTable(
name: "Merges");
migrationBuilder.DropTable(
name: "SoftwareSyntaxes");
migrationBuilder.DropTable(
name: "Languages");
migrationBuilder.DropTable(
name: "Maintainers");
migrationBuilder.DropTable(
name: "Tags");
migrationBuilder.DropTable(
name: "FilterLists");
migrationBuilder.DropTable(
name: "Software");
migrationBuilder.DropTable(
name: "Syntaxes");
migrationBuilder.DropTable(
name: "Licenses");
}
}
}

View file

@ -1,63 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
public partial class _2373 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.InsertData(
table: "FilterLists",
columns: new[] { "Id", "ChatUrl", "Description", "DonateUrl", "EmailAddress", "ForumUrl", "HomeUrl", "IssuesUrl", "LicenseId", "Name", "OnionUrl", "PolicyUrl", "SubmissionUrl" },
values: new object[] { 2497, null, "Filter that enhances privacy by removing tracking parameters from URLs.", null, null, "https://forum.adguard.com/index.php?categories/filter-rules.66/", "https://github.com/AdguardTeam/AdguardFilters", "https://github.com/AdguardTeam/AdguardFilters/issues", 12, "AdGuard URL Tracking filter", null, "https://kb.adguard.com/en/general/adguard-filter-policy", null });
migrationBuilder.InsertData(
table: "FilterListMaintainers",
columns: new[] { "FilterListId", "MaintainerId" },
values: new object[] { 2497, 46 });
migrationBuilder.InsertData(
table: "FilterListSyntaxes",
columns: new[] { "FilterListId", "SyntaxId" },
values: new object[] { 2497, 55 });
migrationBuilder.InsertData(
table: "FilterListTags",
columns: new[] { "FilterListId", "TagId" },
values: new object[] { 2497, 3 });
migrationBuilder.InsertData(
table: "FilterListViewUrls",
columns: new[] { "Id", "FilterListId", "Primariness", "Url" },
values: new object[] { 2708, 2497, (short)1, "https://filters.adtidy.org/windows/filters/17.txt" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DeleteData(
table: "FilterListMaintainers",
keyColumns: new[] { "FilterListId", "MaintainerId" },
keyValues: new object[] { 2497, 46 });
migrationBuilder.DeleteData(
table: "FilterListSyntaxes",
keyColumns: new[] { "FilterListId", "SyntaxId" },
keyValues: new object[] { 2497, 55 });
migrationBuilder.DeleteData(
table: "FilterListTags",
keyColumns: new[] { "FilterListId", "TagId" },
keyValues: new object[] { 2497, 3 });
migrationBuilder.DeleteData(
table: "FilterListViewUrls",
keyColumn: "Id",
keyValue: 2708);
migrationBuilder.DeleteData(
table: "FilterLists",
keyColumn: "Id",
keyValue: 2497);
}
}
}

View file

@ -1,27 +0,0 @@
using Microsoft.EntityFrameworkCore.Migrations;
namespace FilterLists.Directory.Infrastructure.Migrations.Migrations
{
public partial class _2375 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FilterLists",
keyColumn: "Id",
keyValue: 736,
columns: new[] { "Description", "LicenseId", "Name" },
values: new object[] { "The complete catalog for your content blocker!", 2, "Columbia by Osborne" });
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.UpdateData(
table: "FilterLists",
keyColumn: "Id",
keyValue: 736,
columns: new[] { "Description", "LicenseId", "Name" },
values: new object[] { "A systematic Internet filter halting analytics.", 5, "Columbia Analytica" });
}
}
}