fix: AdminCode 컬럼 길이 불일치 수정 (#257) #264

Merged
seonkyu.kim merged 1 commits from fix/#257-login-screen-bugs into develop 2026-02-28 14:19:56 +00:00
4 changed files with 1298 additions and 3 deletions
Showing only changes of commit ecddbe1c26 - Show all commits

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,42 @@
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");
}
}
}

View File

@ -32,8 +32,8 @@ namespace SPMS.Infrastructure.Migrations
b.Property<string>("AdminCode")
.IsRequired()
.HasMaxLength(8)
.HasColumnType("varchar(8)");
.HasMaxLength(12)
.HasColumnType("varchar(12)");
b.Property<bool>("AgreePrivacy")
.HasColumnType("tinyint(1)");

View File

@ -13,7 +13,7 @@ public class AdminConfiguration : IEntityTypeConfiguration<Admin>
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).ValueGeneratedOnAdd();
builder.Property(e => e.AdminCode).HasMaxLength(8).IsRequired();
builder.Property(e => e.AdminCode).HasMaxLength(12).IsRequired();
builder.HasIndex(e => e.AdminCode).IsUnique();
builder.Property(e => e.Email).HasMaxLength(100).IsRequired();