diff --git a/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.Designer.cs
deleted file mode 100644
index 5f60987..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.Designer.cs
+++ /dev/null
@@ -1,282 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250514055354_InitialCreate")]
- partial class InitialCreate
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.cs b/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.cs
deleted file mode 100644
index 05d2c89..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250514055354_InitialCreate.cs
+++ /dev/null
@@ -1,193 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class InitialCreate : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.CreateTable(
- name: "Permissions",
- columns: table => new
- {
- Id = table.Column(type: "text", nullable: false),
- Name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- Code = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- Description = table.Column(type: "character varying(200)", maxLength: 200, nullable: true),
- Type = table.Column(type: "character varying(50)", maxLength: 50, nullable: false),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Permissions", x => x.Id);
- });
-
- migrationBuilder.CreateTable(
- name: "Roles",
- columns: table => new
- {
- Id = table.Column(type: "text", nullable: false, comment: "角色ID,主键"),
- Description = table.Column(type: "character varying(500)", maxLength: 500, nullable: true, comment: "角色描述"),
- Name = table.Column(type: "character varying(256)", maxLength: 256, nullable: false, comment: "角色名称"),
- NormalizedName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false, comment: "标准化角色名称(大写)"),
- ConcurrencyStamp = table.Column(type: "text", nullable: true, comment: "并发控制戳")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Roles", x => x.Id);
- },
- comment: "角色表");
-
- migrationBuilder.CreateTable(
- name: "Users",
- columns: table => new
- {
- Id = table.Column(type: "text", nullable: false, comment: "用户ID,主键"),
- UserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: false, comment: "用户名"),
- NormalizedUserName = table.Column(type: "character varying(256)", maxLength: 256, nullable: true, comment: "标准化用户名(大写)"),
- Email = table.Column(type: "character varying(256)", maxLength: 256, nullable: false, comment: "电子邮箱"),
- NormalizedEmail = table.Column(type: "character varying(256)", maxLength: 256, nullable: true, comment: "标准化电子邮箱(大写)"),
- EmailConfirmed = table.Column(type: "boolean", nullable: false, comment: "邮箱是否已验证"),
- PasswordHash = table.Column(type: "text", nullable: true, comment: "密码哈希值"),
- SecurityStamp = table.Column(type: "text", nullable: true, comment: "安全戳,用于并发控制"),
- ConcurrencyStamp = table.Column(type: "text", nullable: true, comment: "并发控制戳"),
- PhoneNumber = table.Column(type: "text", nullable: false, comment: "电话号码"),
- PhoneNumberConfirmed = table.Column(type: "boolean", nullable: false, comment: "电话号码是否已验证"),
- TwoFactorEnabled = table.Column(type: "boolean", nullable: false, comment: "是否启用双因素认证"),
- LockoutEnd = table.Column(type: "timestamp with time zone", nullable: true, comment: "账户锁定结束时间"),
- LockoutEnabled = table.Column(type: "boolean", nullable: false, comment: "是否启用账户锁定"),
- AccessFailedCount = table.Column(type: "integer", nullable: false, comment: "登录失败次数")
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_Users", x => x.Id);
- },
- comment: "用户表");
-
- migrationBuilder.CreateTable(
- name: "RolePermissions",
- columns: table => new
- {
- RoleId = table.Column(type: "text", nullable: false),
- PermissionId = table.Column(type: "text", nullable: false),
- CreatedAt = table.Column(type: "timestamp with time zone", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_RolePermissions", x => new { x.RoleId, x.PermissionId });
- table.ForeignKey(
- name: "FK_RolePermissions_Permissions_PermissionId",
- column: x => x.PermissionId,
- principalTable: "Permissions",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_RolePermissions_Roles_RoleId",
- column: x => x.RoleId,
- principalTable: "Roles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- });
-
- migrationBuilder.CreateTable(
- name: "UserRoles",
- columns: table => new
- {
- UserId = table.Column(type: "text", nullable: false),
- RoleId = table.Column(type: "text", nullable: false)
- },
- constraints: table =>
- {
- table.PrimaryKey("PK_UserRoles", x => new { x.UserId, x.RoleId });
- table.ForeignKey(
- name: "FK_UserRoles_Roles_RoleId",
- column: x => x.RoleId,
- principalTable: "Roles",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- table.ForeignKey(
- name: "FK_UserRoles_Users_UserId",
- column: x => x.UserId,
- principalTable: "Users",
- principalColumn: "Id",
- onDelete: ReferentialAction.Cascade);
- },
- comment: "用户角色关系表");
-
- migrationBuilder.CreateIndex(
- name: "IX_RolePermissions_PermissionId",
- table: "RolePermissions",
- column: "PermissionId");
-
- migrationBuilder.CreateIndex(
- name: "IX_Roles_Name",
- table: "Roles",
- column: "Name",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "RoleNameIndex",
- table: "Roles",
- column: "NormalizedName",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_UserRoles_RoleId",
- table: "UserRoles",
- column: "RoleId");
-
- migrationBuilder.CreateIndex(
- name: "EmailIndex",
- table: "Users",
- column: "NormalizedEmail");
-
- migrationBuilder.CreateIndex(
- name: "IX_Users_Email",
- table: "Users",
- column: "Email",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Users_PhoneNumber",
- table: "Users",
- column: "PhoneNumber",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "IX_Users_UserName",
- table: "Users",
- column: "UserName",
- unique: true);
-
- migrationBuilder.CreateIndex(
- name: "UserNameIndex",
- table: "Users",
- column: "NormalizedUserName",
- unique: true);
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropTable(
- name: "RolePermissions");
-
- migrationBuilder.DropTable(
- name: "UserRoles");
-
- migrationBuilder.DropTable(
- name: "Permissions");
-
- migrationBuilder.DropTable(
- name: "Roles");
-
- migrationBuilder.DropTable(
- name: "Users");
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.Designer.cs
deleted file mode 100644
index e806b4e..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.Designer.cs
+++ /dev/null
@@ -1,290 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250516021320_AddRoleTimestamps")]
- partial class AddRoleTimestamps
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("更新时间");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.cs b/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.cs
deleted file mode 100644
index 20458d1..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250516021320_AddRoleTimestamps.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class AddRoleTimestamps : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn(
- name: "CreatedAt",
- table: "Roles",
- type: "timestamp with time zone",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
- comment: "创建时间");
-
- migrationBuilder.AddColumn(
- name: "UpdatedAt",
- table: "Roles",
- type: "timestamp with time zone",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
- comment: "更新时间");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "CreatedAt",
- table: "Roles");
-
- migrationBuilder.DropColumn(
- name: "UpdatedAt",
- table: "Roles");
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.Designer.cs
deleted file mode 100644
index bfde0b5..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.Designer.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250519092205_AddAuditFieldsToAppUser")]
- partial class AddAuditFieldsToAppUser
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("更新时间");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("IsActive")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(true)
- .HasComment("用户状态(true: 启用, false: 禁用)");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(false)
- .HasComment("是否已删除");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("ModifiedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("修改时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.cs b/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.cs
deleted file mode 100644
index f8fabbb..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519092205_AddAuditFieldsToAppUser.cs
+++ /dev/null
@@ -1,66 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class AddAuditFieldsToAppUser : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn(
- name: "CreatedTime",
- table: "Users",
- type: "timestamp with time zone",
- nullable: false,
- defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
- comment: "创建时间");
-
- migrationBuilder.AddColumn(
- name: "IsActive",
- table: "Users",
- type: "boolean",
- nullable: false,
- defaultValue: true,
- comment: "用户状态(true: 启用, false: 禁用)");
-
- migrationBuilder.AddColumn(
- name: "IsDeleted",
- table: "Users",
- type: "boolean",
- nullable: false,
- defaultValue: false,
- comment: "是否已删除");
-
- migrationBuilder.AddColumn(
- name: "ModifiedTime",
- table: "Users",
- type: "timestamp with time zone",
- nullable: true,
- comment: "修改时间");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "CreatedTime",
- table: "Users");
-
- migrationBuilder.DropColumn(
- name: "IsActive",
- table: "Users");
-
- migrationBuilder.DropColumn(
- name: "IsDeleted",
- table: "Users");
-
- migrationBuilder.DropColumn(
- name: "ModifiedTime",
- table: "Users");
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.Designer.cs
deleted file mode 100644
index 229c4e2..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.Designer.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250519093405_RemoveDuplicateAuditFields")]
- partial class RemoveDuplicateAuditFields
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("更新时间");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("IsActive")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(true)
- .HasComment("用户状态(true: 启用, false: 禁用)");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(false)
- .HasComment("是否已删除");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("ModifiedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("修改时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.cs b/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.cs
deleted file mode 100644
index 878299b..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519093405_RemoveDuplicateAuditFields.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class RemoveDuplicateAuditFields : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
-
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
-
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.Designer.cs
deleted file mode 100644
index 458c16b..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.Designer.cs
+++ /dev/null
@@ -1,310 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250519093919_UpdateAppUserAuditFields")]
- partial class UpdateAppUserAuditFields
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("更新时间");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("IsActive")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(true)
- .HasComment("用户状态(true: 启用, false: 禁用)");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(false)
- .HasComment("是否已删除");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("ModifiedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("修改时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.cs b/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.cs
deleted file mode 100644
index be21886..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250519093919_UpdateAppUserAuditFields.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class UpdateAppUserAuditFields : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
-
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
-
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.Designer.cs
deleted file mode 100644
index dbc68a8..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.Designer.cs
+++ /dev/null
@@ -1,314 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250520034505_AddLastLoginTime")]
- partial class AddLastLoginTime
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Description")
- .HasMaxLength(500)
- .HasColumnType("character varying(500)")
- .HasComment("角色描述");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("角色名称");
-
- b.Property("NormalizedName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化角色名称(大写)");
-
- b.Property("UpdatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("更新时间");
-
- b.HasKey("Id");
-
- b.HasIndex("Name")
- .IsUnique()
- .HasDatabaseName("IX_Roles_Name");
-
- b.HasIndex("NormalizedName")
- .IsUnique()
- .HasDatabaseName("RoleNameIndex");
-
- b.ToTable("Roles", null, t =>
- {
- t.HasComment("角色表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppUser", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("用户ID,主键");
-
- b.Property("AccessFailedCount")
- .HasColumnType("integer")
- .HasComment("登录失败次数");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property("Email")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("电子邮箱");
-
- b.Property("EmailConfirmed")
- .HasColumnType("boolean")
- .HasComment("邮箱是否已验证");
-
- b.Property("IsActive")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(true)
- .HasComment("用户状态(true: 启用, false: 禁用)");
-
- b.Property("IsDeleted")
- .ValueGeneratedOnAdd()
- .HasColumnType("boolean")
- .HasDefaultValue(false)
- .HasComment("是否已删除");
-
- b.Property("LastLoginTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("最后登录时间");
-
- b.Property("LockoutEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用账户锁定");
-
- b.Property("LockoutEnd")
- .HasColumnType("timestamp with time zone")
- .HasComment("账户锁定结束时间");
-
- b.Property("ModifiedTime")
- .HasColumnType("timestamp with time zone")
- .HasComment("修改时间");
-
- b.Property("NormalizedEmail")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化电子邮箱(大写)");
-
- b.Property("NormalizedUserName")
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("标准化用户名(大写)");
-
- b.Property("PasswordHash")
- .HasColumnType("text")
- .HasComment("密码哈希值");
-
- b.Property("PhoneNumber")
- .IsRequired()
- .HasColumnType("text")
- .HasComment("电话号码");
-
- b.Property("PhoneNumberConfirmed")
- .HasColumnType("boolean")
- .HasComment("电话号码是否已验证");
-
- b.Property("SecurityStamp")
- .HasColumnType("text")
- .HasComment("安全戳,用于并发控制");
-
- b.Property("TwoFactorEnabled")
- .HasColumnType("boolean")
- .HasComment("是否启用双因素认证");
-
- b.Property("UserName")
- .IsRequired()
- .HasMaxLength(256)
- .HasColumnType("character varying(256)")
- .HasComment("用户名");
-
- b.HasKey("Id");
-
- b.HasIndex("Email")
- .IsUnique()
- .HasDatabaseName("IX_Users_Email");
-
- b.HasIndex("NormalizedEmail")
- .HasDatabaseName("EmailIndex");
-
- b.HasIndex("NormalizedUserName")
- .IsUnique()
- .HasDatabaseName("UserNameIndex");
-
- b.HasIndex("PhoneNumber")
- .IsUnique()
- .HasDatabaseName("IX_Users_PhoneNumber");
-
- b.HasIndex("UserName")
- .IsUnique()
- .HasDatabaseName("IX_Users_UserName");
-
- b.ToTable("Users", null, t =>
- {
- t.HasComment("用户表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Property("Id")
- .HasColumnType("text");
-
- b.Property("Code")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.Property("Description")
- .HasMaxLength(200)
- .HasColumnType("character varying(200)");
-
- b.Property("Name")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.Property("Type")
- .IsRequired()
- .HasMaxLength(50)
- .HasColumnType("character varying(50)");
-
- b.HasKey("Id");
-
- b.ToTable("Permissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.Property("PermissionId")
- .HasColumnType("text");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone");
-
- b.HasKey("RoleId", "PermissionId");
-
- b.HasIndex("PermissionId");
-
- b.ToTable("RolePermissions", (string)null);
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.Property("UserId")
- .HasColumnType("text");
-
- b.Property("RoleId")
- .HasColumnType("text");
-
- b.HasKey("UserId", "RoleId");
-
- b.HasIndex("RoleId");
-
- b.ToTable("UserRoles", null, t =>
- {
- t.HasComment("用户角色关系表");
- });
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.RolePermission", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.Permission", "Permission")
- .WithMany("RolePermissions")
- .HasForeignKey("PermissionId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Permission");
-
- b.Navigation("Role");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.UserRole", b =>
- {
- b.HasOne("CellularManagement.Domain.Entities.AppRole", "Role")
- .WithMany()
- .HasForeignKey("RoleId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.HasOne("CellularManagement.Domain.Entities.AppUser", "User")
- .WithMany()
- .HasForeignKey("UserId")
- .OnDelete(DeleteBehavior.Cascade)
- .IsRequired();
-
- b.Navigation("Role");
-
- b.Navigation("User");
- });
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.Permission", b =>
- {
- b.Navigation("RolePermissions");
- });
-#pragma warning restore 612, 618
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.cs b/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.cs
deleted file mode 100644
index fec1fd4..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250520034505_AddLastLoginTime.cs
+++ /dev/null
@@ -1,30 +0,0 @@
-using System;
-using Microsoft.EntityFrameworkCore.Migrations;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- ///
- public partial class AddLastLoginTime : Migration
- {
- ///
- protected override void Up(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.AddColumn(
- name: "LastLoginTime",
- table: "Users",
- type: "timestamp with time zone",
- nullable: true,
- comment: "最后登录时间");
- }
-
- ///
- protected override void Down(MigrationBuilder migrationBuilder)
- {
- migrationBuilder.DropColumn(
- name: "LastLoginTime",
- table: "Users");
- }
- }
-}
diff --git a/src/CellularManagement.Infrastructure/Migrations/20250520044439_AddLoginLog.Designer.cs b/src/CellularManagement.Infrastructure/Migrations/20250520044439_AddLoginLog.Designer.cs
deleted file mode 100644
index e34b0c5..0000000
--- a/src/CellularManagement.Infrastructure/Migrations/20250520044439_AddLoginLog.Designer.cs
+++ /dev/null
@@ -1,396 +0,0 @@
-//
-using System;
-using CellularManagement.Infrastructure.Context;
-using Microsoft.EntityFrameworkCore;
-using Microsoft.EntityFrameworkCore.Infrastructure;
-using Microsoft.EntityFrameworkCore.Migrations;
-using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
-using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
-
-#nullable disable
-
-namespace CellularManagement.Infrastructure.Migrations
-{
- [DbContext(typeof(AppDbContext))]
- [Migration("20250520044439_AddLoginLog")]
- partial class AddLoginLog
- {
- ///
- protected override void BuildTargetModel(ModelBuilder modelBuilder)
- {
-#pragma warning disable 612, 618
- modelBuilder
- .HasAnnotation("ProductVersion", "8.0.0")
- .HasAnnotation("Relational:MaxIdentifierLength", 63);
-
- NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
-
- modelBuilder.Entity("CellularManagement.Domain.Entities.AppRole", b =>
- {
- b.Property("Id")
- .HasColumnType("text")
- .HasComment("角色ID,主键");
-
- b.Property("ConcurrencyStamp")
- .IsConcurrencyToken()
- .HasColumnType("text")
- .HasComment("并发控制戳");
-
- b.Property("CreatedAt")
- .HasColumnType("timestamp with time zone")
- .HasComment("创建时间");
-
- b.Property