using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace Nuuru.Server.Migrations.PostgreSQL
{
///
public partial class RemoveClanEmotes : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "ClanEmotes");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "ClanEmotes",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
ClanId = table.Column(type: "integer", nullable: false),
CreatedAt = table.Column(type: "timestamp with time zone", nullable: false),
Name = table.Column(type: "character varying(30)", maxLength: 30, nullable: false),
StorageIdentifier = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_ClanEmotes", x => x.Id);
table.ForeignKey(
name: "FK_ClanEmotes_Clans_ClanId",
column: x => x.ClanId,
principalTable: "Clans",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_ClanEmotes_ClanId_Name",
table: "ClanEmotes",
columns: new[] { "ClanId", "Name" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_ClanEmotes_Name",
table: "ClanEmotes",
column: "Name",
unique: true);
}
}
}