From b4f8890e1dc194ea9a7e8d260ca4fd363e6b8de4 Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Sat, 27 Jan 2018 06:52:29 -0600 Subject: [PATCH] hard re-do partialRemoveModDateAndMore migration --- .../20180118184938_InitialCreate.cs | 397 ++++++------ .../Migrations/20180126190529_addSnapshot.cs | 33 +- ...80127014225_partialRemoveModDateAndMore.cs | 137 ---- ...5_partialRemoveModDateAndMore.Designer.cs} | 3 +- ...80127125025_partialRemoveModDateAndMore.cs | 119 ++++ .../FilterListsDbContextModelSnapshot.cs | 611 +++++++++--------- src/FilterLists.Api/Startup.cs | 2 +- .../FilterListTypeConfiguration.cs | 3 +- 8 files changed, 631 insertions(+), 674 deletions(-) delete mode 100644 src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.cs rename src/FilterLists.Api/Migrations/{20180127014225_partialRemoveModDateAndMore.Designer.cs => 20180127125025_partialRemoveModDateAndMore.Designer.cs} (99%) create mode 100644 src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.cs diff --git a/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs index c03b15f9a..1b637f698 100644 --- a/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs +++ b/src/FilterLists.Api/Migrations/20180118184938_InitialCreate.cs @@ -1,7 +1,6 @@ -using Microsoft.EntityFrameworkCore.Metadata; +using System; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace FilterLists.Api.Migrations { @@ -10,399 +9,381 @@ public partial class InitialCreate : Migration protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "languages", - columns: table => new + "languages", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("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) + Iso6391 = table.Column("NVARCHAR(2)", nullable: true), + Iso6392 = table.Column("NVARCHAR(3)", nullable: true), + Iso6392B = table.Column("NVARCHAR(3)", nullable: true), + Iso6392T = table.Column("NVARCHAR(3)", nullable: true), + Iso6393 = table.Column("NVARCHAR(3)", nullable: true), + LocalName = table.Column("NVARCHAR(126)", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: true) }, - constraints: table => - { - table.PrimaryKey("PK_languages", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_languages", x => x.Id); }); migrationBuilder.CreateTable( - name: "licenses", - columns: table => new + "licenses", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("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), + DescriptionUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: false), PermissiveAdaptation = table.Column(nullable: false), PermissiveCommercial = table.Column(nullable: false) }, - constraints: table => - { - table.PrimaryKey("PK_licenses", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_licenses", x => x.Id); }); migrationBuilder.CreateTable( - name: "maintainers", - columns: table => new + "maintainers", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("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) + EmailAddress = table.Column("NVARCHAR(126)", nullable: true), + HomeUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: false), + TwitterHandle = table.Column("NVARCHAR(126)", nullable: true) }, - constraints: table => - { - table.PrimaryKey("PK_maintainers", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_maintainers", x => x.Id); }); migrationBuilder.CreateTable( - name: "rules", - columns: table => new + "rules", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false), - Raw = table.Column(type: "NVARCHAR(2083)", nullable: true) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Raw = table.Column("NVARCHAR(2083)", nullable: true) }, - constraints: table => - { - table.PrimaryKey("PK_rules", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_rules", x => x.Id); }); migrationBuilder.CreateTable( - name: "software", - columns: table => new + "software", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("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) + DownloadUrl = table.Column("TEXT", nullable: true), + HomeUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: false) }, - constraints: table => - { - table.PrimaryKey("PK_software", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_software", x => x.Id); }); migrationBuilder.CreateTable( - name: "syntaxes", - columns: table => new + "syntaxes", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("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) + DefinitionUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: false) }, - constraints: table => - { - table.PrimaryKey("PK_syntaxes", x => x.Id); - }); + constraints: table => { table.PrimaryKey("PK_syntaxes", x => x.Id); }); migrationBuilder.CreateTable( - name: "filterlists", - columns: table => new + "filterlists", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Description = table.Column(type: "TEXT", nullable: true), - DescriptionSourceUrl = table.Column(type: "TEXT", nullable: true), + Description = table.Column("TEXT", nullable: true), + DescriptionSourceUrl = table.Column("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), + DonateUrl = table.Column("TEXT", nullable: true), + EmailAddress = table.Column("NVARCHAR(126)", nullable: true), + ForumUrl = table.Column("TEXT", nullable: true), + HomeUrl = table.Column("TEXT", nullable: true), + IssuesUrl = table.Column("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), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126)", nullable: false), + SubmissionUrl = table.Column("TEXT", nullable: true), SyntaxId = table.Column(nullable: true), - ViewUrl = table.Column(type: "TEXT", nullable: true) + ViewUrl = table.Column("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", + "FK_filterlists_licenses_LicenseId", + x => x.LicenseId, + "licenses", + "Id", onDelete: ReferentialAction.Restrict); table.ForeignKey( - name: "FK_filterlists_syntaxes_SyntaxId", - column: x => x.SyntaxId, - principalTable: "syntaxes", - principalColumn: "Id", + "FK_filterlists_syntaxes_SyntaxId", + x => x.SyntaxId, + "syntaxes", + "Id", onDelete: ReferentialAction.Restrict); }); migrationBuilder.CreateTable( - name: "software_syntaxes", - columns: table => new + "software_syntaxes", + table => new { SoftwareId = table.Column(nullable: false), SyntaxId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_software_syntaxes", x => new { x.SoftwareId, x.SyntaxId }); + 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", + "FK_software_syntaxes_software_SoftwareId", + x => x.SoftwareId, + "software", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_software_syntaxes_syntaxes_SyntaxId", - column: x => x.SyntaxId, - principalTable: "syntaxes", - principalColumn: "Id", + "FK_software_syntaxes_syntaxes_SyntaxId", + x => x.SyntaxId, + "syntaxes", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( - name: "filterlists_languages", - columns: table => new + "filterlists_languages", + table => new { FilterListId = table.Column(nullable: false), LanguageId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_filterlists_languages", x => new { x.FilterListId, x.LanguageId }); + 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", + "FK_filterlists_languages_filterlists_FilterListId", + x => x.FilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_filterlists_languages_languages_LanguageId", - column: x => x.LanguageId, - principalTable: "languages", - principalColumn: "Id", + "FK_filterlists_languages_languages_LanguageId", + x => x.LanguageId, + "languages", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( - name: "filterlists_maintainers", - columns: table => new + "filterlists_maintainers", + table => new { FilterListId = table.Column(nullable: false), MaintainerId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_filterlists_maintainers", x => new { x.FilterListId, x.MaintainerId }); + 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", + "FK_filterlists_maintainers_filterlists_FilterListId", + x => x.FilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_filterlists_maintainers_maintainers_MaintainerId", - column: x => x.MaintainerId, - principalTable: "maintainers", - principalColumn: "Id", + "FK_filterlists_maintainers_maintainers_MaintainerId", + x => x.MaintainerId, + "maintainers", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( - name: "filterlists_rules", - columns: table => new + "filterlists_rules", + table => new { FilterListId = table.Column(nullable: false), RuleId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_filterlists_rules", x => new { x.FilterListId, x.RuleId }); + 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", + "FK_filterlists_rules_filterlists_FilterListId", + x => x.FilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_filterlists_rules_rules_RuleId", - column: x => x.RuleId, - principalTable: "rules", - principalColumn: "Id", + "FK_filterlists_rules_rules_RuleId", + x => x.RuleId, + "rules", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( - name: "forks", - columns: table => new + "forks", + table => new { ForkFilterListId = table.Column(nullable: false), UpstreamFilterListId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_forks", x => new { x.ForkFilterListId, x.UpstreamFilterListId }); + 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", + "FK_forks_filterlists_ForkFilterListId", + x => x.ForkFilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_forks_filterlists_UpstreamFilterListId", - column: x => x.UpstreamFilterListId, - principalTable: "filterlists", - principalColumn: "Id", + "FK_forks_filterlists_UpstreamFilterListId", + x => x.UpstreamFilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateTable( - name: "merges", - columns: table => new + "merges", + table => new { MergeFilterListId = table.Column(nullable: false), UpstreamFilterListId = table.Column(nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { - table.PrimaryKey("PK_merges", x => new { x.MergeFilterListId, x.UpstreamFilterListId }); + 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", + "FK_merges_filterlists_MergeFilterListId", + x => x.MergeFilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); table.ForeignKey( - name: "FK_merges_filterlists_UpstreamFilterListId", - column: x => x.UpstreamFilterListId, - principalTable: "filterlists", - principalColumn: "Id", + "FK_merges_filterlists_UpstreamFilterListId", + x => x.UpstreamFilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( - name: "IX_filterlists_LicenseId", - table: "filterlists", - column: "LicenseId"); + "IX_filterlists_LicenseId", + "filterlists", + "LicenseId"); migrationBuilder.CreateIndex( - name: "IX_filterlists_SyntaxId", - table: "filterlists", - column: "SyntaxId"); + "IX_filterlists_SyntaxId", + "filterlists", + "SyntaxId"); migrationBuilder.CreateIndex( - name: "IX_filterlists_languages_LanguageId", - table: "filterlists_languages", - column: "LanguageId"); + "IX_filterlists_languages_LanguageId", + "filterlists_languages", + "LanguageId"); migrationBuilder.CreateIndex( - name: "IX_filterlists_maintainers_MaintainerId", - table: "filterlists_maintainers", - column: "MaintainerId"); + "IX_filterlists_maintainers_MaintainerId", + "filterlists_maintainers", + "MaintainerId"); migrationBuilder.CreateIndex( - name: "IX_filterlists_rules_RuleId", - table: "filterlists_rules", - column: "RuleId"); + "IX_filterlists_rules_RuleId", + "filterlists_rules", + "RuleId"); migrationBuilder.CreateIndex( - name: "IX_forks_UpstreamFilterListId", - table: "forks", - column: "UpstreamFilterListId"); + "IX_forks_UpstreamFilterListId", + "forks", + "UpstreamFilterListId"); migrationBuilder.CreateIndex( - name: "IX_merges_UpstreamFilterListId", - table: "merges", - column: "UpstreamFilterListId"); + "IX_merges_UpstreamFilterListId", + "merges", + "UpstreamFilterListId"); migrationBuilder.CreateIndex( - name: "IX_software_syntaxes_SyntaxId", - table: "software_syntaxes", - column: "SyntaxId"); + "IX_software_syntaxes_SyntaxId", + "software_syntaxes", + "SyntaxId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "filterlists_languages"); + "filterlists_languages"); migrationBuilder.DropTable( - name: "filterlists_maintainers"); + "filterlists_maintainers"); migrationBuilder.DropTable( - name: "filterlists_rules"); + "filterlists_rules"); migrationBuilder.DropTable( - name: "forks"); + "forks"); migrationBuilder.DropTable( - name: "merges"); + "merges"); migrationBuilder.DropTable( - name: "software_syntaxes"); + "software_syntaxes"); migrationBuilder.DropTable( - name: "languages"); + "languages"); migrationBuilder.DropTable( - name: "maintainers"); + "maintainers"); migrationBuilder.DropTable( - name: "rules"); + "rules"); migrationBuilder.DropTable( - name: "filterlists"); + "filterlists"); migrationBuilder.DropTable( - name: "software"); + "software"); migrationBuilder.DropTable( - name: "licenses"); + "licenses"); migrationBuilder.DropTable( - name: "syntaxes"); + "syntaxes"); } } -} +} \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/20180126190529_addSnapshot.cs b/src/FilterLists.Api/Migrations/20180126190529_addSnapshot.cs index 88b1daa51..1f044ea9d 100644 --- a/src/FilterLists.Api/Migrations/20180126190529_addSnapshot.cs +++ b/src/FilterLists.Api/Migrations/20180126190529_addSnapshot.cs @@ -1,7 +1,6 @@ -using Microsoft.EntityFrameworkCore.Metadata; +using System; +using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace FilterLists.Api.Migrations { @@ -10,38 +9,38 @@ public partial class addSnapshot : Migration protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "snapshots", - columns: table => new + "snapshots", + table => new { Id = table.Column(nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), - Content = table.Column(type: "MEDIUMTEXT", nullable: false), - CreatedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + Content = table.Column("MEDIUMTEXT", nullable: false), + CreatedDateUtc = table.Column("TIMESTAMP", nullable: false) .Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn), FilterListId = table.Column(nullable: false), - ModifiedDateUtc = table.Column(type: "TIMESTAMP", nullable: false) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false) }, constraints: table => { table.PrimaryKey("PK_snapshots", x => x.Id); table.ForeignKey( - name: "FK_snapshots_filterlists_FilterListId", - column: x => x.FilterListId, - principalTable: "filterlists", - principalColumn: "Id", + "FK_snapshots_filterlists_FilterListId", + x => x.FilterListId, + "filterlists", + "Id", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( - name: "IX_snapshots_FilterListId", - table: "snapshots", - column: "FilterListId"); + "IX_snapshots_FilterListId", + "snapshots", + "FilterListId"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( - name: "snapshots"); + "snapshots"); } } -} +} \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.cs b/src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.cs deleted file mode 100644 index a69c9b180..000000000 --- a/src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.cs +++ /dev/null @@ -1,137 +0,0 @@ -using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; - -namespace FilterLists.Api.Migrations -{ - public partial class partialRemoveModDateAndMore : Migration - { - protected override void Up(MigrationBuilder migrationBuilder) - { - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "software_syntaxes"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "snapshots"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "rules"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "merges"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "forks"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "filterlists_rules"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "filterlists_maintainers"); - - migrationBuilder.DropColumn( - name: "ModifiedDateUtc", - table: "filterlists_languages"); - - migrationBuilder.AlterColumn( - name: "Raw", - table: "rules", - type: "NVARCHAR(2083)", - nullable: false, - oldClrType: typeof(string), - oldType: "NVARCHAR(2083)", - oldNullable: true); - - migrationBuilder.AlterColumn( - name: "ViewUrl", - table: "filterlists", - type: "TEXT", - nullable: false, - oldClrType: typeof(string), - oldType: "TEXT", - oldNullable: true); - } - - protected override void Down(MigrationBuilder migrationBuilder) - { - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "software_syntaxes", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "snapshots", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AlterColumn( - name: "Raw", - table: "rules", - type: "NVARCHAR(2083)", - nullable: true, - oldClrType: typeof(string), - oldType: "NVARCHAR(2083)"); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "rules", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "merges", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "forks", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "filterlists_rules", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "filterlists_maintainers", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AddColumn( - name: "ModifiedDateUtc", - table: "filterlists_languages", - type: "TIMESTAMP", - nullable: false, - defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); - - migrationBuilder.AlterColumn( - name: "ViewUrl", - table: "filterlists", - type: "TEXT", - nullable: true, - oldClrType: typeof(string), - oldType: "TEXT"); - } - } -} diff --git a/src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.Designer.cs b/src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.Designer.cs similarity index 99% rename from src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.Designer.cs rename to src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.Designer.cs index e267a3983..839b7b1c1 100644 --- a/src/FilterLists.Api/Migrations/20180127014225_partialRemoveModDateAndMore.Designer.cs +++ b/src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.Designer.cs @@ -11,7 +11,7 @@ namespace FilterLists.Api.Migrations { [DbContext(typeof(FilterListsDbContext))] - [Migration("20180127014225_partialRemoveModDateAndMore")] + [Migration("20180127125025_partialRemoveModDateAndMore")] partial class partialRemoveModDateAndMore { protected override void BuildTargetModel(ModelBuilder modelBuilder) @@ -69,7 +69,6 @@ protected override void BuildTargetModel(ModelBuilder modelBuilder) b.Property("SyntaxId"); b.Property("ViewUrl") - .IsRequired() .HasColumnType("TEXT"); b.HasKey("Id"); diff --git a/src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.cs b/src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.cs new file mode 100644 index 000000000..95014835d --- /dev/null +++ b/src/FilterLists.Api/Migrations/20180127125025_partialRemoveModDateAndMore.cs @@ -0,0 +1,119 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +namespace FilterLists.Api.Migrations +{ + public partial class partialRemoveModDateAndMore : Migration + { + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "software_syntaxes"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "snapshots"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "rules"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "merges"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "forks"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "filterlists_rules"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "filterlists_maintainers"); + + migrationBuilder.DropColumn( + "ModifiedDateUtc", + "filterlists_languages"); + + migrationBuilder.AlterColumn( + "Raw", + "rules", + "NVARCHAR(2083)", + nullable: false, + oldClrType: typeof(string), + oldType: "NVARCHAR(2083)", + oldNullable: true); + } + + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "software_syntaxes", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "snapshots", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AlterColumn( + "Raw", + "rules", + "NVARCHAR(2083)", + nullable: true, + oldClrType: typeof(string), + oldType: "NVARCHAR(2083)"); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "rules", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "merges", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "forks", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "filterlists_rules", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "filterlists_maintainers", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + + migrationBuilder.AddColumn( + "ModifiedDateUtc", + "filterlists_languages", + "TIMESTAMP", + nullable: false, + defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified)); + } + } +} \ No newline at end of file diff --git a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs index fd633c29d..22114b02f 100644 --- a/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs +++ b/src/FilterLists.Api/Migrations/FilterListsDbContextModelSnapshot.cs @@ -1,17 +1,15 @@ // + +using System; 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))] - partial class FilterListsDbContextModelSnapshot : ModelSnapshot + internal class FilterListsDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { @@ -21,456 +19,455 @@ protected override void BuildModel(ModelBuilder modelBuilder) .HasAnnotation("ProductVersion", "2.0.1-rtm-125"); modelBuilder.Entity("FilterLists.Data.Entities.FilterList", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("Description") - .HasColumnType("TEXT"); + b.Property("Description") + .HasColumnType("TEXT"); - b.Property("DescriptionSourceUrl") - .HasColumnType("TEXT"); + b.Property("DescriptionSourceUrl") + .HasColumnType("TEXT"); - b.Property("DiscontinuedDate"); + b.Property("DiscontinuedDate"); - b.Property("DonateUrl") - .HasColumnType("TEXT"); + b.Property("DonateUrl") + .HasColumnType("TEXT"); - b.Property("EmailAddress") - .HasColumnType("NVARCHAR(126)"); + b.Property("EmailAddress") + .HasColumnType("NVARCHAR(126)"); - b.Property("ForumUrl") - .HasColumnType("TEXT"); + b.Property("ForumUrl") + .HasColumnType("TEXT"); - b.Property("HomeUrl") - .HasColumnType("TEXT"); + b.Property("HomeUrl") + .HasColumnType("TEXT"); - b.Property("IssuesUrl") - .HasColumnType("TEXT"); + b.Property("IssuesUrl") + .HasColumnType("TEXT"); - b.Property("LicenseId"); + b.Property("LicenseId"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR(126)"); - b.Property("SubmissionUrl") - .HasColumnType("TEXT"); + b.Property("SubmissionUrl") + .HasColumnType("TEXT"); - b.Property("SyntaxId"); + b.Property("SyntaxId"); - b.Property("ViewUrl") - .IsRequired() - .HasColumnType("TEXT"); + b.Property("ViewUrl") + .HasColumnType("TEXT"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("LicenseId"); + b.HasIndex("LicenseId"); - b.HasIndex("SyntaxId"); + b.HasIndex("SyntaxId"); - b.ToTable("filterlists"); - }); + b.ToTable("filterlists"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b => - { - b.Property("FilterListId"); + { + b.Property("FilterListId"); - b.Property("LanguageId"); + b.Property("LanguageId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("FilterListId", "LanguageId"); + b.HasKey("FilterListId", "LanguageId"); - b.HasIndex("LanguageId"); + b.HasIndex("LanguageId"); - b.ToTable("filterlists_languages"); - }); + b.ToTable("filterlists_languages"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b => - { - b.Property("FilterListId"); + { + b.Property("FilterListId"); - b.Property("MaintainerId"); + b.Property("MaintainerId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("FilterListId", "MaintainerId"); + b.HasKey("FilterListId", "MaintainerId"); - b.HasIndex("MaintainerId"); + b.HasIndex("MaintainerId"); - b.ToTable("filterlists_maintainers"); - }); + b.ToTable("filterlists_maintainers"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListRule", b => - { - b.Property("FilterListId"); + { + b.Property("FilterListId"); - b.Property("RuleId"); + b.Property("RuleId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("FilterListId", "RuleId"); + b.HasKey("FilterListId", "RuleId"); - b.HasIndex("RuleId"); + b.HasIndex("RuleId"); - b.ToTable("filterlists_rules"); - }); + b.ToTable("filterlists_rules"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b => - { - b.Property("ForkFilterListId"); + { + b.Property("ForkFilterListId"); - b.Property("UpstreamFilterListId"); + b.Property("UpstreamFilterListId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("ForkFilterListId", "UpstreamFilterListId"); + b.HasKey("ForkFilterListId", "UpstreamFilterListId"); - b.HasIndex("UpstreamFilterListId"); + b.HasIndex("UpstreamFilterListId"); - b.ToTable("forks"); - }); + b.ToTable("forks"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b => - { - b.Property("MergeFilterListId"); + { + b.Property("MergeFilterListId"); - b.Property("UpstreamFilterListId"); + b.Property("UpstreamFilterListId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("MergeFilterListId", "UpstreamFilterListId"); + b.HasKey("MergeFilterListId", "UpstreamFilterListId"); - b.HasIndex("UpstreamFilterListId"); + b.HasIndex("UpstreamFilterListId"); - b.ToTable("merges"); - }); + b.ToTable("merges"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b => - { - b.Property("SoftwareId"); + { + b.Property("SoftwareId"); - b.Property("SyntaxId"); + b.Property("SyntaxId"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.HasKey("SoftwareId", "SyntaxId"); + b.HasKey("SoftwareId", "SyntaxId"); - b.HasIndex("SyntaxId"); + b.HasIndex("SyntaxId"); - b.ToTable("software_syntaxes"); - }); + b.ToTable("software_syntaxes"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Language", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("Iso6391") - .HasColumnType("NVARCHAR(2)"); + b.Property("Iso6391") + .HasColumnType("NVARCHAR(2)"); - b.Property("Iso6392") - .HasColumnType("NVARCHAR(3)"); + b.Property("Iso6392") + .HasColumnType("NVARCHAR(3)"); - b.Property("Iso6392B") - .HasColumnType("NVARCHAR(3)"); + b.Property("Iso6392B") + .HasColumnType("NVARCHAR(3)"); - b.Property("Iso6392T") - .HasColumnType("NVARCHAR(3)"); + b.Property("Iso6392T") + .HasColumnType("NVARCHAR(3)"); - b.Property("Iso6393") - .HasColumnType("NVARCHAR(3)"); + b.Property("Iso6393") + .HasColumnType("NVARCHAR(3)"); - b.Property("LocalName") - .HasColumnType("NVARCHAR(126)"); + b.Property("LocalName") + .HasColumnType("NVARCHAR(126)"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .HasColumnType("NVARCHAR(126)"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("languages"); - }); + b.ToTable("languages"); + }); modelBuilder.Entity("FilterLists.Data.Entities.License", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("DescriptionUrl") - .HasColumnType("TEXT"); + b.Property("DescriptionUrl") + .HasColumnType("TEXT"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR(126)"); - b.Property("PermissiveAdaptation"); + b.Property("PermissiveAdaptation"); - b.Property("PermissiveCommercial"); + b.Property("PermissiveCommercial"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("licenses"); - }); + b.ToTable("licenses"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("EmailAddress") - .HasColumnType("NVARCHAR(126)"); + b.Property("EmailAddress") + .HasColumnType("NVARCHAR(126)"); - b.Property("HomeUrl") - .HasColumnType("TEXT"); + b.Property("HomeUrl") + .HasColumnType("TEXT"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR(126)"); - b.Property("TwitterHandle") - .HasColumnType("NVARCHAR(126)"); + b.Property("TwitterHandle") + .HasColumnType("NVARCHAR(126)"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("maintainers"); - }); + b.ToTable("maintainers"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Rule", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("Raw") - .IsRequired() - .HasColumnType("NVARCHAR(2083)"); + b.Property("Raw") + .IsRequired() + .HasColumnType("NVARCHAR(2083)"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("rules"); - }); + b.ToTable("rules"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("Content") - .IsRequired() - .HasColumnType("MEDIUMTEXT"); + b.Property("Content") + .IsRequired() + .HasColumnType("MEDIUMTEXT"); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("FilterListId"); + b.Property("FilterListId"); - b.HasKey("Id"); + b.HasKey("Id"); - b.HasIndex("FilterListId"); + b.HasIndex("FilterListId"); - b.ToTable("snapshots"); - }); + b.ToTable("snapshots"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Software", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("DownloadUrl") - .HasColumnType("TEXT"); + b.Property("DownloadUrl") + .HasColumnType("TEXT"); - b.Property("HomeUrl") - .HasColumnType("TEXT"); + b.Property("HomeUrl") + .HasColumnType("TEXT"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR(126)"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("software"); - }); + b.ToTable("software"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Syntax", b => - { - b.Property("Id") - .ValueGeneratedOnAdd(); + { + b.Property("Id") + .ValueGeneratedOnAdd(); - b.Property("CreatedDateUtc") - .ValueGeneratedOnAdd() - .HasColumnType("TIMESTAMP"); + b.Property("CreatedDateUtc") + .ValueGeneratedOnAdd() + .HasColumnType("TIMESTAMP"); - b.Property("DefinitionUrl") - .HasColumnType("TEXT"); + b.Property("DefinitionUrl") + .HasColumnType("TEXT"); - b.Property("ModifiedDateUtc") - .ValueGeneratedOnAddOrUpdate() - .HasColumnType("TIMESTAMP"); + b.Property("ModifiedDateUtc") + .ValueGeneratedOnAddOrUpdate() + .HasColumnType("TIMESTAMP"); - b.Property("Name") - .IsRequired() - .HasColumnType("NVARCHAR(126)"); + b.Property("Name") + .IsRequired() + .HasColumnType("NVARCHAR(126)"); - b.HasKey("Id"); + b.HasKey("Id"); - b.ToTable("syntaxes"); - }); + 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.License") + .WithMany("FilterLists") + .HasForeignKey("LicenseId"); - b.HasOne("FilterLists.Data.Entities.Syntax") - .WithMany("FilterLists") - .HasForeignKey("SyntaxId"); - }); + b.HasOne("FilterLists.Data.Entities.Syntax") + .WithMany("FilterLists") + .HasForeignKey("SyntaxId"); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListLanguage", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") - .WithMany("FilterListLanguages") - .HasForeignKey("FilterListId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListLanguages") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.Language", "Language") - .WithMany("FilterListLanguages") - .HasForeignKey("LanguageId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.Language", "Language") + .WithMany("FilterListLanguages") + .HasForeignKey("LanguageId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListMaintainer", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") - .WithMany("FilterListMaintainers") - .HasForeignKey("FilterListId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListMaintainers") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.Maintainer", "Maintainer") - .WithMany("FilterListMaintainers") - .HasForeignKey("MaintainerId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.Maintainer", "Maintainer") + .WithMany("FilterListMaintainers") + .HasForeignKey("MaintainerId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.FilterListRule", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") - .WithMany("FilterListRules") - .HasForeignKey("FilterListId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.FilterList", "FilterList") + .WithMany("FilterListRules") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.Rule", "Rule") - .WithMany("FilterListRules") - .HasForeignKey("RuleId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.Rule", "Rule") + .WithMany("FilterListRules") + .HasForeignKey("RuleId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Fork", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList", "ForkFilterList") - .WithMany() - .HasForeignKey("ForkFilterListId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.FilterList", "ForkFilterList") + .WithMany() + .HasForeignKey("ForkFilterListId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") - .WithMany() - .HasForeignKey("UpstreamFilterListId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") + .WithMany() + .HasForeignKey("UpstreamFilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.Merge", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList", "MergeFilterList") - .WithMany() - .HasForeignKey("MergeFilterListId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.FilterList", "MergeFilterList") + .WithMany() + .HasForeignKey("MergeFilterListId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") - .WithMany() - .HasForeignKey("UpstreamFilterListId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.FilterList", "UpstreamFilterList") + .WithMany() + .HasForeignKey("UpstreamFilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Junctions.SoftwareSyntax", b => - { - b.HasOne("FilterLists.Data.Entities.Software", "Software") - .WithMany("SoftwareSyntaxes") - .HasForeignKey("SoftwareId") - .OnDelete(DeleteBehavior.Cascade); + { + b.HasOne("FilterLists.Data.Entities.Software", "Software") + .WithMany("SoftwareSyntaxes") + .HasForeignKey("SoftwareId") + .OnDelete(DeleteBehavior.Cascade); - b.HasOne("FilterLists.Data.Entities.Syntax", "Syntax") - .WithMany("SoftwareSyntaxes") - .HasForeignKey("SyntaxId") - .OnDelete(DeleteBehavior.Cascade); - }); + b.HasOne("FilterLists.Data.Entities.Syntax", "Syntax") + .WithMany("SoftwareSyntaxes") + .HasForeignKey("SyntaxId") + .OnDelete(DeleteBehavior.Cascade); + }); modelBuilder.Entity("FilterLists.Data.Entities.Snapshot", b => - { - b.HasOne("FilterLists.Data.Entities.FilterList") - .WithMany("Snapshots") - .HasForeignKey("FilterListId") - .OnDelete(DeleteBehavior.Cascade); - }); + { + b.HasOne("FilterLists.Data.Entities.FilterList") + .WithMany("Snapshots") + .HasForeignKey("FilterListId") + .OnDelete(DeleteBehavior.Cascade); + }); #pragma warning restore 612, 618 } } -} +} \ No newline at end of file diff --git a/src/FilterLists.Api/Startup.cs b/src/FilterLists.Api/Startup.cs index b88d092bd..535cf1344 100644 --- a/src/FilterLists.Api/Startup.cs +++ b/src/FilterLists.Api/Startup.cs @@ -42,7 +42,7 @@ public void Configure(IApplicationBuilder app) { routes.MapRoute("default", "v{version:apiVersion}/{controller=Home}/{action=Index}/{id?}"); }); - //MigrateAndSeedDatabase(app); + MigrateAndSeedDatabase(app); } private void MigrateAndSeedDatabase(IApplicationBuilder app) diff --git a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs index 8009db6cf..e0f103e86 100644 --- a/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs +++ b/src/FilterLists.Data/EntityTypeConfigurations/FilterListTypeConfiguration.cs @@ -32,8 +32,7 @@ public override void Configure(EntityTypeBuilder entityTypeBuilder) entityTypeBuilder.Property(x => x.SubmissionUrl) .HasColumnType("TEXT"); entityTypeBuilder.Property(x => x.ViewUrl) - .HasColumnType("TEXT") - .IsRequired(); + .HasColumnType("TEXT"); base.Configure(entityTypeBuilder); } }