hard re-do partialRemoveModDateAndMore migration

This commit is contained in:
Collin M. Barrett 2018-01-27 06:52:29 -06:00
parent 6451fc3249
commit b4f8890e1d
8 changed files with 631 additions and 674 deletions

View file

@ -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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Iso6391 = table.Column<string>(type: "NVARCHAR(2)", nullable: true),
Iso6392 = table.Column<string>(type: "NVARCHAR(3)", nullable: true),
Iso6392B = table.Column<string>(type: "NVARCHAR(3)", nullable: true),
Iso6392T = table.Column<string>(type: "NVARCHAR(3)", nullable: true),
Iso6393 = table.Column<string>(type: "NVARCHAR(3)", nullable: true),
LocalName = table.Column<string>(type: "NVARCHAR(126)", nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: true)
Iso6391 = table.Column<string>("NVARCHAR(2)", nullable: true),
Iso6392 = table.Column<string>("NVARCHAR(3)", nullable: true),
Iso6392B = table.Column<string>("NVARCHAR(3)", nullable: true),
Iso6392T = table.Column<string>("NVARCHAR(3)", nullable: true),
Iso6393 = table.Column<string>("NVARCHAR(3)", nullable: true),
LocalName = table.Column<string>("NVARCHAR(126)", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DescriptionUrl = table.Column<string>(type: "TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: false),
DescriptionUrl = table.Column<string>("TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("NVARCHAR(126)", nullable: false),
PermissiveAdaptation = table.Column<bool>(nullable: false),
PermissiveCommercial = table.Column<bool>(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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
EmailAddress = table.Column<string>(type: "NVARCHAR(126)", nullable: true),
HomeUrl = table.Column<string>(type: "TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: false),
TwitterHandle = table.Column<string>(type: "NVARCHAR(126)", nullable: true)
EmailAddress = table.Column<string>("NVARCHAR(126)", nullable: true),
HomeUrl = table.Column<string>("TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("NVARCHAR(126)", nullable: false),
TwitterHandle = table.Column<string>("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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Raw = table.Column<string>(type: "NVARCHAR(2083)", nullable: true)
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Raw = table.Column<string>("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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DownloadUrl = table.Column<string>(type: "TEXT", nullable: true),
HomeUrl = table.Column<string>(type: "TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: false)
DownloadUrl = table.Column<string>("TEXT", nullable: true),
HomeUrl = table.Column<string>("TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
DefinitionUrl = table.Column<string>(type: "TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: false)
DefinitionUrl = table.Column<string>("TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Description = table.Column<string>(type: "TEXT", nullable: true),
DescriptionSourceUrl = table.Column<string>(type: "TEXT", nullable: true),
Description = table.Column<string>("TEXT", nullable: true),
DescriptionSourceUrl = table.Column<string>("TEXT", nullable: true),
DiscontinuedDate = table.Column<DateTime>(nullable: true),
DonateUrl = table.Column<string>(type: "TEXT", nullable: true),
EmailAddress = table.Column<string>(type: "NVARCHAR(126)", nullable: true),
ForumUrl = table.Column<string>(type: "TEXT", nullable: true),
HomeUrl = table.Column<string>(type: "TEXT", nullable: true),
IssuesUrl = table.Column<string>(type: "TEXT", nullable: true),
DonateUrl = table.Column<string>("TEXT", nullable: true),
EmailAddress = table.Column<string>("NVARCHAR(126)", nullable: true),
ForumUrl = table.Column<string>("TEXT", nullable: true),
HomeUrl = table.Column<string>("TEXT", nullable: true),
IssuesUrl = table.Column<string>("TEXT", nullable: true),
LicenseId = table.Column<int>(nullable: true),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false),
Name = table.Column<string>(type: "NVARCHAR(126)", nullable: false),
SubmissionUrl = table.Column<string>(type: "TEXT", nullable: true),
ModifiedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false),
Name = table.Column<string>("NVARCHAR(126)", nullable: false),
SubmissionUrl = table.Column<string>("TEXT", nullable: true),
SyntaxId = table.Column<int>(nullable: true),
ViewUrl = table.Column<string>(type: "TEXT", nullable: true)
ViewUrl = table.Column<string>("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<int>(nullable: false),
SyntaxId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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<int>(nullable: false),
LanguageId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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<int>(nullable: false),
MaintainerId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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<int>(nullable: false),
RuleId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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<int>(nullable: false),
UpstreamFilterListId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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<int>(nullable: false),
UpstreamFilterListId = table.Column<int>(nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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");
}
}
}
}

View file

@ -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<int>(nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
Content = table.Column<string>(type: "MEDIUMTEXT", nullable: false),
CreatedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
Content = table.Column<string>("MEDIUMTEXT", nullable: false),
CreatedDateUtc = table.Column<DateTime>("TIMESTAMP", nullable: false)
.Annotation("MySql:ValueGenerationStrategy", MySqlValueGenerationStrategy.IdentityColumn),
FilterListId = table.Column<int>(nullable: false),
ModifiedDateUtc = table.Column<DateTime>(type: "TIMESTAMP", nullable: false)
ModifiedDateUtc = table.Column<DateTime>("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");
}
}
}
}

View file

@ -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<string>(
name: "Raw",
table: "rules",
type: "NVARCHAR(2083)",
nullable: false,
oldClrType: typeof(string),
oldType: "NVARCHAR(2083)",
oldNullable: true);
migrationBuilder.AlterColumn<string>(
name: "ViewUrl",
table: "filterlists",
type: "TEXT",
nullable: false,
oldClrType: typeof(string),
oldType: "TEXT",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "software_syntaxes",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "snapshots",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AlterColumn<string>(
name: "Raw",
table: "rules",
type: "NVARCHAR(2083)",
nullable: true,
oldClrType: typeof(string),
oldType: "NVARCHAR(2083)");
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "rules",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "merges",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "forks",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "filterlists_rules",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "filterlists_maintainers",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
name: "ModifiedDateUtc",
table: "filterlists_languages",
type: "TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AlterColumn<string>(
name: "ViewUrl",
table: "filterlists",
type: "TEXT",
nullable: true,
oldClrType: typeof(string),
oldType: "TEXT");
}
}
}

View file

@ -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<int?>("SyntaxId");
b.Property<string>("ViewUrl")
.IsRequired()
.HasColumnType("TEXT");
b.HasKey("Id");

View file

@ -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<string>(
"Raw",
"rules",
"NVARCHAR(2083)",
nullable: false,
oldClrType: typeof(string),
oldType: "NVARCHAR(2083)",
oldNullable: true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"software_syntaxes",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"snapshots",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AlterColumn<string>(
"Raw",
"rules",
"NVARCHAR(2083)",
nullable: true,
oldClrType: typeof(string),
oldType: "NVARCHAR(2083)");
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"rules",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"merges",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"forks",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"filterlists_rules",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"filterlists_maintainers",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
migrationBuilder.AddColumn<DateTime>(
"ModifiedDateUtc",
"filterlists_languages",
"TIMESTAMP",
nullable: false,
defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));
}
}
}

View file

@ -1,17 +1,15 @@
// <auto-generated />
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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("Description")
.HasColumnType("TEXT");
b.Property<string>("DescriptionSourceUrl")
.HasColumnType("TEXT");
b.Property<string>("DescriptionSourceUrl")
.HasColumnType("TEXT");
b.Property<DateTime?>("DiscontinuedDate");
b.Property<DateTime?>("DiscontinuedDate");
b.Property<string>("DonateUrl")
.HasColumnType("TEXT");
b.Property<string>("DonateUrl")
.HasColumnType("TEXT");
b.Property<string>("EmailAddress")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("EmailAddress")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("ForumUrl")
.HasColumnType("TEXT");
b.Property<string>("ForumUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<string>("IssuesUrl")
.HasColumnType("TEXT");
b.Property<string>("IssuesUrl")
.HasColumnType("TEXT");
b.Property<int?>("LicenseId");
b.Property<int?>("LicenseId");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("SubmissionUrl")
.HasColumnType("TEXT");
b.Property<string>("SubmissionUrl")
.HasColumnType("TEXT");
b.Property<int?>("SyntaxId");
b.Property<int?>("SyntaxId");
b.Property<string>("ViewUrl")
.IsRequired()
.HasColumnType("TEXT");
b.Property<string>("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<int>("FilterListId");
{
b.Property<int>("FilterListId");
b.Property<int>("LanguageId");
b.Property<int>("LanguageId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("FilterListId");
{
b.Property<int>("FilterListId");
b.Property<int>("MaintainerId");
b.Property<int>("MaintainerId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("FilterListId");
{
b.Property<int>("FilterListId");
b.Property<int>("RuleId");
b.Property<int>("RuleId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("ForkFilterListId");
{
b.Property<int>("ForkFilterListId");
b.Property<int>("UpstreamFilterListId");
b.Property<int>("UpstreamFilterListId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("MergeFilterListId");
{
b.Property<int>("MergeFilterListId");
b.Property<int>("UpstreamFilterListId");
b.Property<int>("UpstreamFilterListId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("SoftwareId");
{
b.Property<int>("SoftwareId");
b.Property<int>("SyntaxId");
b.Property<int>("SyntaxId");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("Iso6391")
.HasColumnType("NVARCHAR(2)");
b.Property<string>("Iso6391")
.HasColumnType("NVARCHAR(2)");
b.Property<string>("Iso6392")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6392")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6392B")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6392B")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6392T")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6392T")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6393")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("Iso6393")
.HasColumnType("NVARCHAR(3)");
b.Property<string>("LocalName")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("LocalName")
.HasColumnType("NVARCHAR(126)");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("DescriptionUrl")
.HasColumnType("TEXT");
b.Property<string>("DescriptionUrl")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<bool>("PermissiveAdaptation");
b.Property<bool>("PermissiveAdaptation");
b.Property<bool>("PermissiveCommercial");
b.Property<bool>("PermissiveCommercial");
b.HasKey("Id");
b.HasKey("Id");
b.ToTable("licenses");
});
b.ToTable("licenses");
});
modelBuilder.Entity("FilterLists.Data.Entities.Maintainer", b =>
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("EmailAddress")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("EmailAddress")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("TwitterHandle")
.HasColumnType("NVARCHAR(126)");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("Raw")
.IsRequired()
.HasColumnType("NVARCHAR(2083)");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<string>("Content")
.IsRequired()
.HasColumnType("MEDIUMTEXT");
b.Property<string>("Content")
.IsRequired()
.HasColumnType("MEDIUMTEXT");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<int>("FilterListId");
b.Property<int>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("DownloadUrl")
.HasColumnType("TEXT");
b.Property<string>("DownloadUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<string>("HomeUrl")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("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<int>("Id")
.ValueGeneratedOnAdd();
{
b.Property<int>("Id")
.ValueGeneratedOnAdd();
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("CreatedDateUtc")
.ValueGeneratedOnAdd()
.HasColumnType("TIMESTAMP");
b.Property<string>("DefinitionUrl")
.HasColumnType("TEXT");
b.Property<string>("DefinitionUrl")
.HasColumnType("TEXT");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<DateTime>("ModifiedDateUtc")
.ValueGeneratedOnAddOrUpdate()
.HasColumnType("TIMESTAMP");
b.Property<string>("Name")
.IsRequired()
.HasColumnType("NVARCHAR(126)");
b.Property<string>("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
}
}
}
}

View file

@ -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)

View file

@ -32,8 +32,7 @@ public override void Configure(EntityTypeBuilder<FilterList> entityTypeBuilder)
entityTypeBuilder.Property(x => x.SubmissionUrl)
.HasColumnType("TEXT");
entityTypeBuilder.Property(x => x.ViewUrl)
.HasColumnType("TEXT")
.IsRequired();
.HasColumnType("TEXT");
base.Configure(entityTypeBuilder);
}
}