45 lines
1.5 KiB
C#
45 lines
1.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace RMuseum.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class WordCounts : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "CategoryWordCounts",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uniqueidentifier", nullable: false),
|
|
CatId = table.Column<int>(type: "int", nullable: false),
|
|
Word = table.Column<string>(type: "nvarchar(450)", nullable: true),
|
|
Count = table.Column<int>(type: "int", nullable: false),
|
|
PoetCat = table.Column<bool>(type: "bit", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_CategoryWordCounts", x => x.Id);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_CategoryWordCounts_CatId_Word",
|
|
table: "CategoryWordCounts",
|
|
columns: new[] { "CatId", "Word" },
|
|
unique: true,
|
|
filter: "[Word] IS NOT NULL");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "CategoryWordCounts");
|
|
}
|
|
}
|
|
}
|