using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace CalledIt.DataAccess.Migrations
{
    /// <inheritdoc />
    public partial class ReplaceLogoBlobsWithFileName : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "LogoData",
                table: "Teams");

            migrationBuilder.DropColumn(
                name: "LogoData",
                table: "Competitions");

            migrationBuilder.RenameColumn(
                name: "LogoContentType",
                table: "Teams",
                newName: "LogoFileName");

            migrationBuilder.RenameColumn(
                name: "LogoContentType",
                table: "Competitions",
                newName: "LogoFileName");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.RenameColumn(
                name: "LogoFileName",
                table: "Teams",
                newName: "LogoContentType");

            migrationBuilder.RenameColumn(
                name: "LogoFileName",
                table: "Competitions",
                newName: "LogoContentType");

            migrationBuilder.AddColumn<byte[]>(
                name: "LogoData",
                table: "Teams",
                type: "bytea",
                nullable: true);

            migrationBuilder.AddColumn<byte[]>(
                name: "LogoData",
                table: "Competitions",
                type: "bytea",
                nullable: true);
        }
    }
}
