diff --git a/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.Designer.cs b/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.Designer.cs deleted file mode 100644 index cdf40677b..000000000 --- a/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.Designer.cs +++ /dev/null @@ -1,248 +0,0 @@ -// -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("20171028200037_InitialCreate")] - partial class InitialCreate - { - 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("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("MaintainerId"); - - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(126); - - b.Property("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("MaintainerId"); - - 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.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.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.Maintainer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); - - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); - - b.Property("Email") - .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.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.FilterList", b => - { - 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.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 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.cs b/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.cs deleted file mode 100644 index bfa1be42e..000000000 --- a/src/FilterLists.Api/Migrations/20171028200037_InitialCreate.cs +++ /dev/null @@ -1,193 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class InitialCreate : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "languages", - 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), - Iso6391 = table.Column(type: "varchar(2)", maxLength: 2, nullable: true), - Iso6392 = table.Column(type: "varchar(3)", maxLength: 3, nullable: true), - Iso6392B = table.Column(type: "varchar(3)", maxLength: 3, nullable: true), - Iso6392T = table.Column(type: "varchar(3)", maxLength: 3, nullable: true), - Iso6393 = table.Column(type: "varchar(3)", maxLength: 3, nullable: true), - LocalName = table.Column(type: "varchar(126)", maxLength: 126, nullable: true), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), - Name = table.Column(type: "varchar(126)", maxLength: 126, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_languages", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "maintainers", - 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), - Email = table.Column(type: "varchar(126)", maxLength: 126, nullable: true), - HomeUrl = 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), - TwitterHandle = table.Column(type: "varchar(126)", maxLength: 126, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_maintainers", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "software", - 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), - DownloadUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - HomeUrl = 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: true) - }, - constraints: table => - { - table.PrimaryKey("PK_software", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "filterlists", - 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), - Description = table.Column(type: "varchar(4096)", maxLength: 4096, nullable: true), - DescriptionSourceUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - DonateUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - EmailAddress = table.Column(type: "varchar(126)", maxLength: 126, nullable: true), - ForumUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - HomeUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - IssuesUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true), - MaintainerId = table.Column(type: "int", nullable: true), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), - Name = table.Column(type: "varchar(126)", maxLength: 126, nullable: false), - ViewUrl = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_filterlists", x => x.Id); - table.ForeignKey( - name: "FK_filterlists_maintainers_MaintainerId", - column: x => x.MaintainerId, - principalTable: "maintainers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - }); - - migrationBuilder.CreateTable( - name: "filterlists_languages", - columns: table => new - { - FilterListId = table.Column(type: "int", nullable: false), - LanguageId = 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_filterlists_languages", x => new { x.FilterListId, x.LanguageId }); - table.ForeignKey( - name: "FK_filterlists_languages_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_filterlists_languages_languages_LanguageId", - column: x => x.LanguageId, - principalTable: "languages", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateTable( - name: "filterlists_software", - columns: table => new - { - FilterListId = table.Column(type: "int", nullable: false), - SoftwareId = 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_filterlists_software", x => new { x.FilterListId, x.SoftwareId }); - table.ForeignKey( - name: "FK_filterlists_software_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_filterlists_software_software_SoftwareId", - column: x => x.SoftwareId, - principalTable: "software", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_MaintainerId", - table: "filterlists", - column: "MaintainerId"); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_languages_LanguageId", - table: "filterlists_languages", - column: "LanguageId"); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_software_SoftwareId", - table: "filterlists_software", - column: "SoftwareId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "filterlists_languages"); - - migrationBuilder.DropTable( - name: "filterlists_software"); - - migrationBuilder.DropTable( - name: "languages"); - - migrationBuilder.DropTable( - name: "filterlists"); - - migrationBuilder.DropTable( - name: "software"); - - migrationBuilder.DropTable( - name: "maintainers"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171031235408_add Rules.Designer.cs b/src/FilterLists.Api/Migrations/20171031235408_add Rules.Designer.cs deleted file mode 100644 index c7d9e7443..000000000 --- a/src/FilterLists.Api/Migrations/20171031235408_add Rules.Designer.cs +++ /dev/null @@ -1,303 +0,0 @@ -// -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("20171031235408_add Rules")] - partial class addRules - { - 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("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("MaintainerId"); - - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); - - b.Property("Name") - .IsRequired() - .HasMaxLength(126); - - b.Property("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("MaintainerId"); - - 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.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.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.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.FilterList", b => - { - 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 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171031235408_add Rules.cs b/src/FilterLists.Api/Migrations/20171031235408_add Rules.cs deleted file mode 100644 index e913ffccc..000000000 --- a/src/FilterLists.Api/Migrations/20171031235408_add Rules.cs +++ /dev/null @@ -1,91 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class addRules : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "Email", - table: "maintainers"); - - migrationBuilder.AddColumn( - name: "EmailAddress", - table: "maintainers", - type: "varchar(126)", - maxLength: 126, - nullable: true); - - migrationBuilder.CreateTable( - name: "rules", - 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), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), - Raw = table.Column(type: "varchar(2083)", maxLength: 2083, nullable: true) - }, - constraints: table => - { - table.PrimaryKey("PK_rules", x => x.Id); - }); - - migrationBuilder.CreateTable( - name: "filterlists_rules", - columns: table => new - { - FilterListId = table.Column(type: "int", nullable: false), - RuleId = 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_filterlists_rules", x => new { x.FilterListId, x.RuleId }); - table.ForeignKey( - name: "FK_filterlists_rules_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_filterlists_rules_rules_RuleId", - column: x => x.RuleId, - principalTable: "rules", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_rules_RuleId", - table: "filterlists_rules", - column: "RuleId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "filterlists_rules"); - - migrationBuilder.DropTable( - name: "rules"); - - migrationBuilder.DropColumn( - name: "EmailAddress", - table: "maintainers"); - - migrationBuilder.AddColumn( - name: "Email", - table: "maintainers", - maxLength: 126, - nullable: true); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101011709_add License.Designer.cs b/src/FilterLists.Api/Migrations/20171101011709_add License.Designer.cs deleted file mode 100644 index 7e1e89be6..000000000 --- a/src/FilterLists.Api/Migrations/20171101011709_add License.Designer.cs +++ /dev/null @@ -1,340 +0,0 @@ -// -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("20171101011709_add License")] - partial class addLicense - { - 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("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("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("LicenseId"); - - b.HasIndex("MaintainerId"); - - 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.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("PermissiveRedistribution"); - - b.Property("PermissiveUsage"); - - 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.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.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 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101011709_add License.cs b/src/FilterLists.Api/Migrations/20171101011709_add License.cs deleted file mode 100644 index 72e002fec..000000000 --- a/src/FilterLists.Api/Migrations/20171101011709_add License.cs +++ /dev/null @@ -1,69 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class addLicense : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "LicenseId", - table: "filterlists", - type: "int", - nullable: true); - - migrationBuilder.CreateTable( - name: "licenses", - 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), - DescriptionUrl = 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), - PermissiveRedistribution = table.Column(type: "bit", nullable: false), - PermissiveUsage = table.Column(type: "bit", nullable: false) - }, - constraints: table => - { - table.PrimaryKey("PK_licenses", x => x.Id); - }); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_LicenseId", - table: "filterlists", - column: "LicenseId"); - - migrationBuilder.AddForeignKey( - name: "FK_filterlists_licenses_LicenseId", - table: "filterlists", - column: "LicenseId", - principalTable: "licenses", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_filterlists_licenses_LicenseId", - table: "filterlists"); - - migrationBuilder.DropTable( - name: "licenses"); - - migrationBuilder.DropIndex( - name: "IX_filterlists_LicenseId", - table: "filterlists"); - - migrationBuilder.DropColumn( - name: "LicenseId", - table: "filterlists"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.Designer.cs b/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.Designer.cs deleted file mode 100644 index dfe7e98aa..000000000 --- a/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.Designer.cs +++ /dev/null @@ -1,343 +0,0 @@ -// -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("Id") - .ValueGeneratedOnAdd(); - - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); - - b.Property("Description") - .HasMaxLength(4096); - - b.Property("DescriptionSourceUrl") - .HasMaxLength(2083); - - 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("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("LicenseId"); - - b.HasIndex("MaintainerId"); - - 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.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.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.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 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.cs b/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.cs deleted file mode 100644 index e466db9dc..000000000 --- a/src/FilterLists.Api/Migrations/20171101015403_add Submission URL, modify License bool names.cs +++ /dev/null @@ -1,68 +0,0 @@ -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( - name: "PermissiveAdaptation", - table: "licenses", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "PermissiveCommercial", - table: "licenses", - type: "bit", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - 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( - name: "PermissiveRedistribution", - table: "licenses", - nullable: false, - defaultValue: false); - - migrationBuilder.AddColumn( - name: "PermissiveUsage", - table: "licenses", - nullable: false, - defaultValue: false); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101113123_add Fork.Designer.cs b/src/FilterLists.Api/Migrations/20171101113123_add Fork.Designer.cs deleted file mode 100644 index 3998bfc4b..000000000 --- a/src/FilterLists.Api/Migrations/20171101113123_add Fork.Designer.cs +++ /dev/null @@ -1,377 +0,0 @@ -// -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("20171101113123_add Fork")] - partial class addFork - { - 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("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("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("LicenseId"); - - b.HasIndex("MaintainerId"); - - 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.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.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); - }); - - 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); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101113123_add Fork.cs b/src/FilterLists.Api/Migrations/20171101113123_add Fork.cs deleted file mode 100644 index b4771323e..000000000 --- a/src/FilterLists.Api/Migrations/20171101113123_add Fork.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class addFork : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "forks", - columns: table => new - { - ForkFilterListId = table.Column(type: "int", nullable: false), - UpstreamFilterListId = 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_forks", x => new { x.ForkFilterListId, x.UpstreamFilterListId }); - 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.CreateIndex( - name: "IX_forks_UpstreamFilterListId", - table: "forks", - column: "UpstreamFilterListId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "forks"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101122824_Add Merge.Designer.cs b/src/FilterLists.Api/Migrations/20171101122824_Add Merge.Designer.cs deleted file mode 100644 index 8356f980e..000000000 --- a/src/FilterLists.Api/Migrations/20171101122824_Add Merge.Designer.cs +++ /dev/null @@ -1,411 +0,0 @@ -// -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("20171101122824_Add Merge")] - partial class AddMerge - { - 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("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("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("LicenseId"); - - b.HasIndex("MaintainerId"); - - 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.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); - }); - - 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); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171101122824_Add Merge.cs b/src/FilterLists.Api/Migrations/20171101122824_Add Merge.cs deleted file mode 100644 index 7aba665bf..000000000 --- a/src/FilterLists.Api/Migrations/20171101122824_Add Merge.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class AddMerge : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "merges", - columns: table => new - { - MergeFilterListId = table.Column(type: "int", nullable: false), - UpstreamFilterListId = 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_merges", x => new { x.MergeFilterListId, x.UpstreamFilterListId }); - table.ForeignKey( - name: "FK_merges_filterlists_MergeFilterListId", - column: x => x.MergeFilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_merges_filterlists_UpstreamFilterListId", - column: x => x.UpstreamFilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_merges_UpstreamFilterListId", - table: "merges", - column: "UpstreamFilterListId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "merges"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.Designer.cs b/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.Designer.cs deleted file mode 100644 index 8d06f79e6..000000000 --- a/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.Designer.cs +++ /dev/null @@ -1,413 +0,0 @@ -// -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("20171104020037_add DiscontinuedDate to FilterList")] - partial class addDiscontinuedDatetoFilterList - { - 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("ViewUrl") - .HasMaxLength(2083); - - b.HasKey("Id"); - - b.HasIndex("LicenseId"); - - b.HasIndex("MaintainerId"); - - 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.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); - }); - - 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); - }); -#pragma warning restore 612, 618 - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.cs b/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.cs deleted file mode 100644 index 307a6fdbe..000000000 --- a/src/FilterLists.Api/Migrations/20171104020037_add DiscontinuedDate to FilterList.cs +++ /dev/null @@ -1,25 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class addDiscontinuedDatetoFilterList : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "DiscontinuedDate", - table: "filterlists", - type: "datetime(6)", - nullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "DiscontinuedDate", - table: "filterlists"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs b/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs deleted file mode 100644 index f957e33c8..000000000 --- a/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.Designer.cs +++ /dev/null @@ -1,480 +0,0 @@ -// -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 deleted file mode 100644 index b2d9524eb..000000000 --- a/src/FilterLists.Api/Migrations/20171104143224_add Syntax entity.cs +++ /dev/null @@ -1,102 +0,0 @@ -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/20171104145044_remove FilterListsSoftware.Designer.cs b/src/FilterLists.Api/Migrations/20171104145044_remove FilterListsSoftware.Designer.cs deleted file mode 100644 index ff85623a3..000000000 --- a/src/FilterLists.Api/Migrations/20171104145044_remove FilterListsSoftware.Designer.cs +++ /dev/null @@ -1,446 +0,0 @@ -// -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("20171104145044_remove FilterListsSoftware")] - partial class removeFilterListsSoftware - { - 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.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.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/20171104145044_remove FilterListsSoftware.cs b/src/FilterLists.Api/Migrations/20171104145044_remove FilterListsSoftware.cs deleted file mode 100644 index 80c8b00c0..000000000 --- a/src/FilterLists.Api/Migrations/20171104145044_remove FilterListsSoftware.cs +++ /dev/null @@ -1,51 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class removeFilterListsSoftware : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "filterlists_software"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.CreateTable( - name: "filterlists_software", - columns: table => new - { - FilterListId = table.Column(nullable: false), - SoftwareId = table.Column(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_filterlists_software", x => new { x.FilterListId, x.SoftwareId }); - table.ForeignKey( - name: "FK_filterlists_software_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_filterlists_software_software_SoftwareId", - column: x => x.SoftwareId, - principalTable: "software", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_software_SoftwareId", - table: "filterlists_software", - column: "SoftwareId"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.cs b/src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.cs deleted file mode 100644 index ce63c7648..000000000 --- a/src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.cs +++ /dev/null @@ -1,81 +0,0 @@ -using Microsoft.EntityFrameworkCore.Metadata; -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class addFilterListMaintainer : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropForeignKey( - name: "FK_filterlists_maintainers_MaintainerId", - table: "filterlists"); - - migrationBuilder.DropIndex( - name: "IX_filterlists_MaintainerId", - table: "filterlists"); - - migrationBuilder.DropColumn( - name: "MaintainerId", - table: "filterlists"); - - migrationBuilder.CreateTable( - name: "filterlists_maintainers", - columns: table => new - { - FilterListId = table.Column(type: "int", nullable: false), - MaintainerId = 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_filterlists_maintainers", x => new { x.FilterListId, x.MaintainerId }); - table.ForeignKey( - name: "FK_filterlists_maintainers_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - table.ForeignKey( - name: "FK_filterlists_maintainers_maintainers_MaintainerId", - column: x => x.MaintainerId, - principalTable: "maintainers", - principalColumn: "Id", - onDelete: ReferentialAction.Cascade); - }); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_maintainers_MaintainerId", - table: "filterlists_maintainers", - column: "MaintainerId"); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropTable( - name: "filterlists_maintainers"); - - migrationBuilder.AddColumn( - name: "MaintainerId", - table: "filterlists", - nullable: true); - - migrationBuilder.CreateIndex( - name: "IX_filterlists_MaintainerId", - table: "filterlists", - column: "MaintainerId"); - - migrationBuilder.AddForeignKey( - name: "FK_filterlists_maintainers_MaintainerId", - table: "filterlists", - column: "MaintainerId", - principalTable: "maintainers", - principalColumn: "Id", - onDelete: ReferentialAction.Restrict); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.Designer.cs b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.Designer.cs similarity index 90% rename from src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.Designer.cs rename to src/FilterLists.Api/Migrations/20180118184938_InitialCreate.Designer.cs index 6a7e76079..59de07f3b 100644 --- a/src/FilterLists.Api/Migrations/20171104161431_add FilterListMaintainer.Designer.cs +++ b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.Designer.cs @@ -11,15 +11,15 @@ namespace FilterLists.Api.Migrations { [DbContext(typeof(FilterListsDbContext))] - [Migration("20171104161431_add FilterListMaintainer")] - partial class addFilterListMaintainer + [Migration("20180118184938_InitialCreate")] + partial class InitialCreate { protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); + .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => { @@ -31,27 +31,27 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Description") - .HasMaxLength(4096); + .HasColumnType("TEXT"); b.Property("DescriptionSourceUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("DiscontinuedDate"); b.Property("DonateUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("EmailAddress") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("ForumUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("IssuesUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("LicenseId"); @@ -61,15 +61,15 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("SubmissionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("SyntaxId"); b.Property("ViewUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.HasKey("Id"); @@ -174,29 +174,29 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Iso6391") - .HasMaxLength(2); + .HasColumnType("NVARCHAR(2)"); b.Property("Iso6392") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6392B") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6392T") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6393") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("LocalName") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() .HasColumnType("TIMESTAMP"); b.Property("Name") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -213,7 +213,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DescriptionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -221,7 +221,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("PermissiveAdaptation"); @@ -242,10 +242,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("EmailAddress") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -253,10 +253,10 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("TwitterHandle") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -298,7 +298,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Raw") - .HasMaxLength(2083); + .HasColumnType("NVARCHAR(2083)"); b.HasKey("Id"); @@ -315,17 +315,18 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DownloadUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() .HasColumnType("TIMESTAMP"); b.Property("Name") - .HasMaxLength(126); + .IsRequired() + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -363,7 +364,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DefinitionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -371,7 +372,7 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); diff --git a/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs new file mode 100644 index 000000000..c03b15f9a --- /dev/null +++ b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs @@ -0,0 +1,408 @@ +using Microsoft.EntityFrameworkCore.Metadata; +using Microsoft.EntityFrameworkCore.Migrations; +using System; +using System.Collections.Generic; + +namespace FilterLists.Api.Migrations +{ + public partial class InitialCreate : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "languages", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Iso6391 = table.Column(type: "NVARCHAR(2)", nullable: true), + Iso6392 = table.Column(type: "NVARCHAR(3)", nullable: true), + Iso6392B = table.Column(type: "NVARCHAR(3)", nullable: true), + Iso6392T = table.Column(type: "NVARCHAR(3)", nullable: true), + Iso6393 = table.Column(type: "NVARCHAR(3)", nullable: true), + LocalName = table.Column(type: "NVARCHAR(126)", nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_languages", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "licenses", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DescriptionUrl = table.Column(type: "TEXT", nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: false), + PermissiveAdaptation = table.Column(nullable: false), + PermissiveCommercial = table.Column(nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_licenses", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "maintainers", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + EmailAddress = table.Column(type: "NVARCHAR(126)", nullable: true), + HomeUrl = table.Column(type: "TEXT", nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: false), + TwitterHandle = table.Column(type: "NVARCHAR(126)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_maintainers", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "rules", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Raw = table.Column(type: "NVARCHAR(2083)", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_rules", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "software", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DownloadUrl = table.Column(type: "TEXT", nullable: true), + HomeUrl = table.Column(type: "TEXT", nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_software", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "syntaxes", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + DefinitionUrl = table.Column(type: "TEXT", nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_syntaxes", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "filterlists", + columns: table => new + { + Id = table.Column(nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), + Description = table.Column(type: "TEXT", nullable: true), + DescriptionSourceUrl = table.Column(type: "TEXT", nullable: true), + DiscontinuedDate = table.Column(nullable: true), + DonateUrl = table.Column(type: "TEXT", nullable: true), + EmailAddress = table.Column(type: "NVARCHAR(126)", nullable: true), + ForumUrl = table.Column(type: "TEXT", nullable: true), + HomeUrl = table.Column(type: "TEXT", nullable: true), + IssuesUrl = table.Column(type: "TEXT", nullable: true), + LicenseId = table.Column(nullable: true), + ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), + Name = table.Column(type: "NVARCHAR(126)", nullable: false), + SubmissionUrl = table.Column(type: "TEXT", nullable: true), + SyntaxId = table.Column(nullable: true), + ViewUrl = table.Column(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); + table.ForeignKey( + name: "FK_filterlists_syntaxes_SyntaxId", + column: x => x.SyntaxId, + principalTable: "syntaxes", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "software_syntaxes", + columns: table => new + { + SoftwareId = table.Column(nullable: false), + SyntaxId = table.Column(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.CreateTable( + name: "filterlists_languages", + columns: table => new + { + FilterListId = table.Column(nullable: false), + LanguageId = table.Column(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_filterlists_languages", x => new { x.FilterListId, x.LanguageId }); + table.ForeignKey( + name: "FK_filterlists_languages_filterlists_FilterListId", + column: x => x.FilterListId, + principalTable: "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_filterlists_languages_languages_LanguageId", + column: x => x.LanguageId, + principalTable: "languages", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "filterlists_maintainers", + columns: table => new + { + FilterListId = table.Column(nullable: false), + MaintainerId = table.Column(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_filterlists_maintainers", x => new { x.FilterListId, x.MaintainerId }); + table.ForeignKey( + name: "FK_filterlists_maintainers_filterlists_FilterListId", + column: x => x.FilterListId, + principalTable: "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_filterlists_maintainers_maintainers_MaintainerId", + column: x => x.MaintainerId, + principalTable: "maintainers", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "filterlists_rules", + columns: table => new + { + FilterListId = table.Column(nullable: false), + RuleId = table.Column(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_filterlists_rules", x => new { x.FilterListId, x.RuleId }); + table.ForeignKey( + name: "FK_filterlists_rules_filterlists_FilterListId", + column: x => x.FilterListId, + principalTable: "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_filterlists_rules_rules_RuleId", + column: x => x.RuleId, + principalTable: "rules", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateTable( + name: "forks", + columns: table => new + { + ForkFilterListId = table.Column(nullable: false), + UpstreamFilterListId = table.Column(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_forks", x => new { x.ForkFilterListId, x.UpstreamFilterListId }); + 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 + { + MergeFilterListId = table.Column(nullable: false), + UpstreamFilterListId = table.Column(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_merges", x => new { x.MergeFilterListId, x.UpstreamFilterListId }); + table.ForeignKey( + name: "FK_merges_filterlists_MergeFilterListId", + column: x => x.MergeFilterListId, + principalTable: "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + table.ForeignKey( + name: "FK_merges_filterlists_UpstreamFilterListId", + column: x => x.UpstreamFilterListId, + principalTable: "filterlists", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "IX_filterlists_LicenseId", + table: "filterlists", + column: "LicenseId"); + + migrationBuilder.CreateIndex( + name: "IX_filterlists_SyntaxId", + table: "filterlists", + column: "SyntaxId"); + + migrationBuilder.CreateIndex( + name: "IX_filterlists_languages_LanguageId", + table: "filterlists_languages", + column: "LanguageId"); + + migrationBuilder.CreateIndex( + name: "IX_filterlists_maintainers_MaintainerId", + table: "filterlists_maintainers", + column: "MaintainerId"); + + migrationBuilder.CreateIndex( + name: "IX_filterlists_rules_RuleId", + table: "filterlists_rules", + column: "RuleId"); + + migrationBuilder.CreateIndex( + name: "IX_forks_UpstreamFilterListId", + table: "forks", + column: "UpstreamFilterListId"); + + migrationBuilder.CreateIndex( + name: "IX_merges_UpstreamFilterListId", + table: "merges", + column: "UpstreamFilterListId"); + + migrationBuilder.CreateIndex( + name: "IX_software_syntaxes_SyntaxId", + table: "software_syntaxes", + column: "SyntaxId"); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "filterlists_languages"); + + migrationBuilder.DropTable( + name: "filterlists_maintainers"); + + migrationBuilder.DropTable( + name: "filterlists_rules"); + + migrationBuilder.DropTable( + name: "forks"); + + migrationBuilder.DropTable( + name: "merges"); + + migrationBuilder.DropTable( + name: "software_syntaxes"); + + migrationBuilder.DropTable( + name: "languages"); + + migrationBuilder.DropTable( + name: "maintainers"); + + migrationBuilder.DropTable( + name: "rules"); + + migrationBuilder.DropTable( + name: "filterlists"); + + migrationBuilder.DropTable( + name: "software"); + + migrationBuilder.DropTable( + name: "licenses"); + + migrationBuilder.DropTable( + name: "syntaxes"); + } + } +} diff --git a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs index 14fbc023d..bfb493ca7 100644 --- a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs +++ b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs @@ -18,7 +18,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) #pragma warning disable 612, 618 modelBuilder .HasAnnotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn) - .HasAnnotation("ProductVersion", "2.0.0-rtm-26452"); + .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => { @@ -30,27 +30,27 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Description") - .HasMaxLength(4096); + .HasColumnType("TEXT"); b.Property("DescriptionSourceUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("DiscontinuedDate"); b.Property("DonateUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("EmailAddress") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("ForumUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("IssuesUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("LicenseId"); @@ -60,15 +60,15 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("SubmissionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("SyntaxId"); b.Property("ViewUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.HasKey("Id"); @@ -173,29 +173,29 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Iso6391") - .HasMaxLength(2); + .HasColumnType("NVARCHAR(2)"); b.Property("Iso6392") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6392B") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6392T") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("Iso6393") - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); b.Property("LocalName") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() .HasColumnType("TIMESTAMP"); b.Property("Name") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -212,7 +212,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DescriptionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -220,7 +220,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("PermissiveAdaptation"); @@ -241,10 +241,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("EmailAddress") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -252,10 +252,10 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.Property("TwitterHandle") - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -297,7 +297,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("Raw") - .HasMaxLength(2083); + .HasColumnType("NVARCHAR(2083)"); b.HasKey("Id"); @@ -314,17 +314,18 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DownloadUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("HomeUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() .HasColumnType("TIMESTAMP"); b.Property("Name") - .HasMaxLength(126); + .IsRequired() + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); @@ -362,7 +363,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasColumnType("TIMESTAMP"); b.Property("DefinitionUrl") - .HasMaxLength(2083); + .HasColumnType("TEXT"); b.Property("ModifiedDateUtc") .ValueGeneratedOnAddOrUpdate() @@ -370,7 +371,7 @@ protected override void BuildModel(ModelBuilder modelBuilder) b.Property("Name") .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); b.HasKey("Id"); diff --git a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs index 06ce42d63..185ca5bd6 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs @@ -16,8 +16,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.DonateUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.EmailAddress) - .IsUnicode() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); entityTypeBuilder.Property(x => x.ForumUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.HomeUrl) @@ -25,9 +24,8 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.IssuesUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)") + .IsRequired(); entityTypeBuilder.Property(x => x.SubmissionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.ViewUrl) diff --git a/src/FilterLists.Data/EntityTypeConfigurations/LanguageTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/LanguageTypeConfiguration.cs index 86367b40a..a37450983 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/LanguageTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/LanguageTypeConfiguration.cs @@ -10,26 +10,19 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { entityTypeBuilder.ToTable("languages"); entityTypeBuilder.Property(x => x.Iso6391) - .IsUnicode() - .HasMaxLength(2); + .HasColumnType("NVARCHAR(2)"); entityTypeBuilder.Property(x => x.Iso6392) - .IsUnicode() - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); entityTypeBuilder.Property(x => x.Iso6392B) - .IsUnicode() - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); entityTypeBuilder.Property(x => x.Iso6392T) - .IsUnicode() - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); entityTypeBuilder.Property(x => x.Iso6393) - .IsUnicode() - .HasMaxLength(3); + .HasColumnType("NVARCHAR(3)"); entityTypeBuilder.Property(x => x.LocalName) - .IsUnicode() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); base.Configure(entityTypeBuilder); } } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs index b6235c91e..d12b6b64b 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/LicenseTypeConfiguration.cs @@ -12,9 +12,8 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.DescriptionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)") + .IsRequired(); base.Configure(entityTypeBuilder); } } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/MaintainerTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/MaintainerTypeConfiguration.cs index 2b8eb03aa..95239c3a9 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/MaintainerTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/MaintainerTypeConfiguration.cs @@ -10,17 +10,14 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { entityTypeBuilder.ToTable("maintainers"); entityTypeBuilder.Property(x => x.EmailAddress) - .IsUnicode() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); entityTypeBuilder.Property(x => x.HomeUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)") + .IsRequired(); entityTypeBuilder.Property(x => x.TwitterHandle) - .IsUnicode() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)"); base.Configure(entityTypeBuilder); } } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs index 60b712bbe..6af964a04 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/RuleTypeConfiguration.cs @@ -10,8 +10,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) { entityTypeBuilder.ToTable("rules"); entityTypeBuilder.Property(x => x.Raw) - .IsUnicode() - .HasMaxLength(2083); + .HasColumnType("NVARCHAR(2083)"); base.Configure(entityTypeBuilder); } } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs index bad4a8429..fdef874a2 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/SoftwareTypeConfiguration.cs @@ -14,9 +14,8 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.HomeUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)") + .IsRequired(); base.Configure(entityTypeBuilder); } } diff --git a/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs index 67609310a..7be00ce5c 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/SyntaxTypeConfiguration.cs @@ -12,9 +12,8 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.DefinitionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.Name) - .IsUnicode() - .IsRequired() - .HasMaxLength(126); + .HasColumnType("NVARCHAR(126)") + .IsRequired(); base.Configure(entityTypeBuilder); } }