Files
chapter-organizer/Data/Migrations/20251003164320_TeamIdentifier.cs
T
poprhythm 6407dfca71 Remove Team.Number
Add Team.Identifier
2025-10-03 12:47:05 -04:00

54 lines
1.4 KiB
C#

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);
}
}
}