using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Nuuru.Server.Migrations.PostgreSQL
{
///
public partial class ReplaceBlacklistWithDefaultSearchQuery : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "UserBlacklistedTags");
migrationBuilder.AddColumn(
name: "DefaultSearchQuery",
table: "UserSettings",
type: "character varying(500)",
maxLength: 500,
nullable: false,
defaultValue: "");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "DefaultSearchQuery",
table: "UserSettings");
migrationBuilder.CreateTable(
name: "UserBlacklistedTags",
columns: table => new
{
UserId = table.Column(type: "uuid", nullable: false),
TagId = table.Column(type: "uuid", nullable: false),
CreatedAt = table.Column(type: "timestamp with time zone", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_UserBlacklistedTags", x => new { x.UserId, x.TagId });
table.ForeignKey(
name: "FK_UserBlacklistedTags_AspNetUsers_UserId",
column: x => x.UserId,
principalTable: "AspNetUsers",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_UserBlacklistedTags_BooruTags_TagId",
column: x => x.TagId,
principalTable: "BooruTags",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_UserBlacklistedTags_TagId",
table: "UserBlacklistedTags",
column: "TagId");
migrationBuilder.CreateIndex(
name: "IX_UserBlacklistedTags_UserId",
table: "UserBlacklistedTags",
column: "UserId");
}
}
}