SPMS_API/SPMS.Infrastructure/Migrations/20260226083344_ExpandAdminCodeLength.cs
SEAN ecddbe1c26 fix: AdminCode 컬럼 길이 불일치 수정 (#257)
- HasMaxLength(8) → HasMaxLength(12) 변경
- 코드에서 12자 UUID를 생성하나 DB가 8자만 허용하는 버그
- 회원가입 시 'Data too long for column AdminCode' 500 에러 해결
2026-02-26 17:36:33 +09:00

43 lines
1.3 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace SPMS.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class ExpandAdminCodeLength : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "AdminCode",
table: "Admin",
type: "varchar(12)",
maxLength: 12,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(8)",
oldMaxLength: 8)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<string>(
name: "AdminCode",
table: "Admin",
type: "varchar(8)",
maxLength: 8,
nullable: false,
oldClrType: typeof(string),
oldType: "varchar(12)",
oldMaxLength: 12)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
}
}
}