using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

namespace Data.Migrations
{
    /// <inheritdoc />
    public partial class TeamIdentifier : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {

            migrationBuilder.AddColumn<string>(
                name: "Identifier",
                table: "Teams",
                type: "TEXT",
                maxLength: 32,
                nullable: true);

            migrationBuilder.Sql("UPDATE Teams SET Identifier = Number");

            migrationBuilder.DropColumn(
                name: "Number",
                table: "Teams");

            migrationBuilder.DropColumn(
                name: "TeamId",
                table: "Teams");

        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "Identifier",
                table: "Teams");

            migrationBuilder.AddColumn<int>(
                name: "Number",
                table: "Teams",
                type: "INTEGER",
                nullable: true);

            migrationBuilder.AddColumn<string>(
                name: "TeamId",
                table: "Teams",
                type: "TEXT",
                nullable: true);
        }
    }
}
