From 34992c5896370125c7fd762aba5a309704a29b9c Mon Sep 17 00:00:00 2001 From: "Collin M. Barrett" Date: Wed, 31 Jan 2018 17:47:07 -0600 Subject: [PATCH] super minor cleanup --- .../20180128204823_InitialCreate.cs | 399 +++++++++--------- ...52_TweakVarcharCollationAndWidenRuleRaw.cs | 196 +++++---- .../Extensions/ConfigureServicesCollection.cs | 2 +- 3 files changed, 288 insertions(+), 309 deletions(-) diff --git a/src/FilterLists.Api/Migrations/20180128204823_InitialCreate.cs b/src/FilterLists.Api/Migrations/20180128204823_InitialCreate.cs index 7baedf042..8ebf8dae9 100644 --- a/src/FilterLists.Api/Migrations/20180128204823_InitialCreate.cs +++ b/src/FilterLists.Api/Migrations/20180128204823_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,395 +9,377 @@ public partial class InitialCreate : Migration protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( - name: "languages", - columns: table => new + "languages", + table => new { - Id = table.Column(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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) NOT NULL", nullable: true), + DescriptionUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126) NOT NULL", nullable: true), 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(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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) NOT NULL", nullable: true), - 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) NOT NULL", nullable: true), + 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(type: "BIGINT UNSIGNED", nullable: false) + Id = table.Column("BIGINT UNSIGNED", 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) NOT NULL", nullable: true) + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Raw = table.Column("NVARCHAR(2083) NOT NULL", 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(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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) NOT NULL", nullable: true) + DownloadUrl = table.Column("TEXT", nullable: true), + HomeUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126) NOT NULL", nullable: true) }, - 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(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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) NOT NULL", nullable: true) + DefinitionUrl = table.Column("TEXT", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126) NOT NULL", nullable: true) }, - 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(type: "SMALLINT UNSIGNED", nullable: false) + Id = table.Column("SMALLINT UNSIGNED", 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) NOT NULL", nullable: true), + ModifiedDateUtc = table.Column("TIMESTAMP", nullable: false), + Name = table.Column("NVARCHAR(126) NOT NULL", nullable: true), ScrapedDateUtc = table.Column(nullable: true), - SubmissionUrl = table.Column(type: "TEXT", nullable: true), + SubmissionUrl = table.Column("TEXT", nullable: true), SyntaxId = table.Column(nullable: true), UpdatedDateUtc = table.Column(nullable: true), - ViewUrl = table.Column(type: "TEXT NOT NULL", nullable: true) + ViewUrl = table.Column("TEXT NOT NULL", 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) }, 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) }, 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) }, 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) }, 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) }, 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) }, 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/20180130170852_TweakVarcharCollationAndWidenRuleRaw.cs b/src/FilterLists.Api/Migrations/20180130170852_TweakVarcharCollationAndWidenRuleRaw.cs index c6c05e325..c6f79bb2f 100644 --- a/src/FilterLists.Api/Migrations/20180130170852_TweakVarcharCollationAndWidenRuleRaw.cs +++ b/src/FilterLists.Api/Migrations/20180130170852_TweakVarcharCollationAndWidenRuleRaw.cs @@ -1,6 +1,4 @@ using Microsoft.EntityFrameworkCore.Migrations; -using System; -using System.Collections.Generic; namespace FilterLists.Api.Migrations { @@ -9,144 +7,144 @@ public partial class TweakVarcharCollationAndWidenRuleRaw : Migration protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( - name: "Name", - table: "syntaxes", - type: "VARCHAR(126) NOT NULL", + "Name", + "syntaxes", + "VARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "software", - type: "VARCHAR(126) NOT NULL", + "Name", + "software", + "VARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Raw", - table: "rules", - type: "VARCHAR(16384) NOT NULL COLLATE 'utf8_unicode_ci'", + "Raw", + "rules", + "VARCHAR(16384) NOT NULL COLLATE 'utf8_unicode_ci'", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(2083) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "TwitterHandle", - table: "maintainers", - type: "VARCHAR(126)", + "TwitterHandle", + "maintainers", + "VARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "maintainers", - type: "VARCHAR(126) NOT NULL", + "Name", + "maintainers", + "VARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "EmailAddress", - table: "maintainers", - type: "VARCHAR(126)", + "EmailAddress", + "maintainers", + "VARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "licenses", - type: "VARCHAR(126) NOT NULL", + "Name", + "licenses", + "VARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "languages", - type: "VARCHAR(126)", + "Name", + "languages", + "VARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "LocalName", - table: "languages", - type: "VARCHAR(126)", + "LocalName", + "languages", + "VARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6393", - table: "languages", - type: "VARCHAR(3)", + "Iso6393", + "languages", + "VARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392T", - table: "languages", - type: "VARCHAR(3)", + "Iso6392T", + "languages", + "VARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392B", - table: "languages", - type: "VARCHAR(3)", + "Iso6392B", + "languages", + "VARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392", - table: "languages", - type: "VARCHAR(3)", + "Iso6392", + "languages", + "VARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6391", - table: "languages", - type: "VARCHAR(2)", + "Iso6391", + "languages", + "VARCHAR(2)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(2)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "filterlists", - type: "VARCHAR(126) NOT NULL", + "Name", + "filterlists", + "VARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "EmailAddress", - table: "filterlists", - type: "VARCHAR(126)", + "EmailAddress", + "filterlists", + "VARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "NVARCHAR(126)", @@ -156,148 +154,148 @@ protected override void Up(MigrationBuilder migrationBuilder) protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.AlterColumn( - name: "Name", - table: "syntaxes", - type: "NVARCHAR(126) NOT NULL", + "Name", + "syntaxes", + "NVARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "software", - type: "NVARCHAR(126) NOT NULL", + "Name", + "software", + "NVARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Raw", - table: "rules", - type: "NVARCHAR(2083) NOT NULL", + "Raw", + "rules", + "NVARCHAR(2083) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(16384) NOT NULL COLLATE 'utf8_unicode_ci'", oldNullable: true); migrationBuilder.AlterColumn( - name: "TwitterHandle", - table: "maintainers", - type: "NVARCHAR(126)", + "TwitterHandle", + "maintainers", + "NVARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "maintainers", - type: "NVARCHAR(126) NOT NULL", + "Name", + "maintainers", + "NVARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "EmailAddress", - table: "maintainers", - type: "NVARCHAR(126)", + "EmailAddress", + "maintainers", + "NVARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "licenses", - type: "NVARCHAR(126) NOT NULL", + "Name", + "licenses", + "NVARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "languages", - type: "NVARCHAR(126)", + "Name", + "languages", + "NVARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "LocalName", - table: "languages", - type: "NVARCHAR(126)", + "LocalName", + "languages", + "NVARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6393", - table: "languages", - type: "NVARCHAR(3)", + "Iso6393", + "languages", + "NVARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392T", - table: "languages", - type: "NVARCHAR(3)", + "Iso6392T", + "languages", + "NVARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392B", - table: "languages", - type: "NVARCHAR(3)", + "Iso6392B", + "languages", + "NVARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6392", - table: "languages", - type: "NVARCHAR(3)", + "Iso6392", + "languages", + "NVARCHAR(3)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(3)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Iso6391", - table: "languages", - type: "NVARCHAR(2)", + "Iso6391", + "languages", + "NVARCHAR(2)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(2)", oldNullable: true); migrationBuilder.AlterColumn( - name: "Name", - table: "filterlists", - type: "NVARCHAR(126) NOT NULL", + "Name", + "filterlists", + "NVARCHAR(126) NOT NULL", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126) NOT NULL", oldNullable: true); migrationBuilder.AlterColumn( - name: "EmailAddress", - table: "filterlists", - type: "NVARCHAR(126)", + "EmailAddress", + "filterlists", + "NVARCHAR(126)", nullable: true, oldClrType: typeof(string), oldType: "VARCHAR(126)", oldNullable: true); } } -} +} \ No newline at end of file diff --git a/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs b/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs index b8bb7eeff..ab2dfb04c 100644 --- a/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs +++ b/src/FilterLists.Services/DependencyInjection/Extensions/ConfigureServicesCollection.cs @@ -15,8 +15,8 @@ public static void AddFilterListsServices(this IServiceCollection services, ICon services.AddEntityFrameworkMySql().AddDbContextPool(options => options.UseMySql(configuration.GetConnectionString("FilterListsConnection"), b => b.MigrationsAssembly("FilterLists.Api"))); - services.TryAddScoped(); services.TryAddScoped(); + services.TryAddScoped(); services.TryAddScoped(); services.AddAutoMapper(); }