// using System; using IM.Admin.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Metadata; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; #nullable disable namespace Admin.WebApi.Data.Migrations { [DbContext(typeof(AdminDb))] [Migration("20260915004233_InitialAdmin")] partial class InitialAdmin { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "9.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 64); MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder); modelBuilder.Entity("IM.Admin.Data.AdminAccount", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Account") .IsRequired() .HasMaxLength(100) .HasColumnType("varchar(100)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Email") .IsRequired() .HasColumnType("longtext"); b.Property("Enabled") .HasColumnType("tinyint(1)"); b.Property("FailedAttempts") .HasColumnType("int"); b.Property("LockedUntil") .HasColumnType("datetime(6)"); b.Property("Name") .IsRequired() .HasColumnType("longtext"); b.Property("PasswordHash") .IsRequired() .HasColumnType("longtext"); b.Property("Role") .IsRequired() .HasColumnType("longtext"); b.Property("Stamp") .IsConcurrencyToken() .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("Account") .IsUnique(); b.ToTable("admin_accounts", (string)null); }); modelBuilder.Entity("IM.Admin.Data.AuditRecord", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Action") .IsRequired() .HasColumnType("longtext"); b.Property("ActorId") .HasColumnType("char(36)"); b.Property("ActorName") .IsRequired() .HasColumnType("longtext"); b.Property("After") .IsRequired() .HasColumnType("longtext"); b.Property("Before") .IsRequired() .HasColumnType("longtext"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("OperationId") .HasColumnType("char(36)"); b.Property("Reason") .IsRequired() .HasColumnType("longtext"); b.Property("ReportId") .HasColumnType("char(36)"); b.Property("Result") .IsRequired() .HasColumnType("longtext"); b.Property("TargetId") .IsRequired() .HasColumnType("longtext"); b.Property("TargetName") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("CreatedAt"); b.HasIndex("OperationId") .IsUnique(); b.ToTable("admin_audit", (string)null); }); modelBuilder.Entity("IM.Admin.Data.Operation", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("Action") .IsRequired() .HasColumnType("longtext"); b.Property("ActorId") .HasColumnType("char(36)"); b.Property("ActorName") .IsRequired() .HasColumnType("longtext"); b.Property("Attempts") .HasColumnType("int"); b.Property("CompletedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Error") .HasColumnType("longtext"); b.Property("NextAttemptAt") .HasColumnType("datetime(6)"); b.Property("Reason") .IsRequired() .HasColumnType("longtext"); b.Property("ReportId") .HasColumnType("char(36)"); b.Property("Status") .IsRequired() .HasMaxLength(30) .HasColumnType("varchar(30)"); b.Property("TargetId") .HasColumnType("char(36)"); b.Property("Type") .IsRequired() .HasColumnType("longtext"); b.HasKey("Id"); b.HasIndex("Status", "NextAttemptAt"); b.ToTable("admin_operations", (string)null); }); modelBuilder.Entity("IM.Admin.Data.PasswordReset", b => { b.Property("Id") .HasMaxLength(64) .HasColumnType("varchar(64)"); b.Property("AccountId") .HasColumnType("char(36)"); b.Property("ExpiresAt") .HasColumnType("datetime(6)"); b.HasKey("Id"); b.ToTable("admin_password_resets", (string)null); }); modelBuilder.Entity("IM.Admin.Data.Report", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("char(36)"); b.Property("AssigneeId") .HasColumnType("char(36)"); b.Property("ClosedAt") .HasColumnType("datetime(6)"); b.Property("CreatedAt") .HasColumnType("datetime(6)"); b.Property("Description") .IsRequired() .HasColumnType("longtext"); b.Property("Evidence") .IsRequired() .HasColumnType("longtext"); b.Property("Reason") .IsRequired() .HasColumnType("longtext"); b.Property("ReporterId") .HasColumnType("char(36)"); b.Property("Result") .HasColumnType("longtext"); b.Property("Status") .IsRequired() .HasMaxLength(30) .HasColumnType("varchar(30)"); b.Property("TargetId") .HasColumnType("char(36)"); b.Property("TargetName") .IsRequired() .HasColumnType("longtext"); b.Property("Type") .IsRequired() .HasColumnType("longtext"); b.Property("Version") .IsConcurrencyToken() .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("ReporterId", "CreatedAt"); b.HasIndex("Status", "CreatedAt"); b.ToTable("admin_reports", (string)null); }); modelBuilder.Entity("IM.Admin.Data.SystemSetting", b => { b.Property("Id") .HasMaxLength(64) .HasColumnType("varchar(64)"); b.Property("Draft") .HasColumnType("longtext"); b.Property("DraftSecret") .HasColumnType("longtext"); b.Property("Secret") .IsRequired() .HasColumnType("longtext"); b.Property("TestedVersion") .HasColumnType("bigint"); b.Property("UpdatedAt") .HasColumnType("datetime(6)"); b.Property("Value") .IsRequired() .HasColumnType("longtext"); b.Property("Version") .IsConcurrencyToken() .HasColumnType("bigint"); b.HasKey("Id"); b.ToTable("admin_settings", (string)null); }); #pragma warning restore 612, 618 } } }