// using System; using System.Collections.Generic; using Fengling.AuthService.Data; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; #nullable disable namespace Fengling.AuthService.Migrations { [DbContext(typeof(ApplicationDbContext))] partial class ApplicationDbContextModelSnapshot : ModelSnapshot { protected override void BuildModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.2") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("Fengling.AuthService.Models.AccessLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Action") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Duration") .HasColumnType("integer"); b.Property("ErrorMessage") .HasColumnType("text"); b.Property("IpAddress") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Method") .HasMaxLength(10) .HasColumnType("character varying(10)"); b.Property("RequestData") .HasColumnType("text"); b.Property("Resource") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("ResponseData") .HasColumnType("text"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("TenantId") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("UserAgent") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("UserName") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.HasKey("Id"); b.HasIndex("Action"); b.HasIndex("CreatedAt"); b.HasIndex("Status"); b.HasIndex("TenantId"); b.HasIndex("UserName"); b.ToTable("AccessLogs"); }); modelBuilder.Entity("Fengling.AuthService.Models.ApplicationRole", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("CreatedTime") .HasColumnType("timestamp with time zone"); b.Property("Description") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("DisplayName") .HasColumnType("text"); b.Property("IsSystem") .HasColumnType("boolean"); b.Property("Name") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("NormalizedName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.PrimitiveCollection>("Permissions") .HasColumnType("text[]"); b.Property("TenantId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("NormalizedName") .IsUnique() .HasDatabaseName("RoleNameIndex"); b.ToTable("AspNetRoles", (string)null); }); modelBuilder.Entity("Fengling.AuthService.Models.ApplicationUser", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("AccessFailedCount") .HasColumnType("integer"); b.Property("ConcurrencyStamp") .IsConcurrencyToken() .HasColumnType("text"); b.Property("CreatedTime") .HasColumnType("timestamp with time zone"); b.Property("Email") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("EmailConfirmed") .HasColumnType("boolean"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("LockoutEnabled") .HasColumnType("boolean"); b.Property("LockoutEnd") .HasColumnType("timestamp with time zone"); b.Property("NormalizedEmail") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("NormalizedUserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.Property("PasswordHash") .HasColumnType("text"); b.Property("Phone") .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("PhoneNumber") .HasColumnType("text"); b.Property("PhoneNumberConfirmed") .HasColumnType("boolean"); b.Property("RealName") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("SecurityStamp") .HasColumnType("text"); b.Property("TwoFactorEnabled") .HasColumnType("boolean"); b.Property("UpdatedTime") .HasColumnType("timestamp with time zone"); b.Property("UserName") .HasMaxLength(256) .HasColumnType("character varying(256)"); b.HasKey("Id"); b.HasIndex("NormalizedEmail") .HasDatabaseName("EmailIndex"); b.HasIndex("NormalizedUserName") .IsUnique() .HasDatabaseName("UserNameIndex"); b.HasIndex("Phone") .IsUnique(); b.ToTable("AspNetUsers", (string)null); }); modelBuilder.Entity("Fengling.AuthService.Models.AuditLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Action") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("ErrorMessage") .HasColumnType("text"); b.Property("IpAddress") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("NewValue") .HasColumnType("text"); b.Property("OldValue") .HasColumnType("text"); b.Property("Operation") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("Operator") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("TargetId") .HasColumnType("bigint"); b.Property("TargetName") .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("TargetType") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("TenantId") .HasMaxLength(50) .HasColumnType("character varying(50)"); b.HasKey("Id"); b.HasIndex("Action"); b.HasIndex("CreatedAt"); b.HasIndex("Operation"); b.HasIndex("Operator"); b.HasIndex("TenantId"); b.ToTable("AuditLogs"); }); modelBuilder.Entity("Fengling.AuthService.Models.OAuthApplication", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClientId") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("ClientSecret") .HasMaxLength(200) .HasColumnType("character varying(200)"); b.Property("ClientType") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("ConsentType") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("DisplayName") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.PrimitiveCollection("GrantTypes") .IsRequired() .HasColumnType("text[]"); b.PrimitiveCollection("PostLogoutRedirectUris") .IsRequired() .HasColumnType("text[]"); b.PrimitiveCollection("RedirectUris") .IsRequired() .HasColumnType("text[]"); b.PrimitiveCollection("Scopes") .IsRequired() .HasColumnType("text[]"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("ClientId") .IsUnique(); b.ToTable("OAuthApplications"); }); modelBuilder.Entity("Fengling.AuthService.Models.Tenant", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ContactEmail") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("ContactName") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("ContactPhone") .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); b.Property("Description") .HasMaxLength(500) .HasColumnType("character varying(500)"); b.Property("ExpiresAt") .HasColumnType("timestamp with time zone"); b.Property("IsDeleted") .HasColumnType("boolean"); b.Property("MaxUsers") .HasColumnType("integer"); b.Property("Name") .IsRequired() .HasMaxLength(100) .HasColumnType("character varying(100)"); b.Property("Status") .IsRequired() .HasMaxLength(20) .HasColumnType("character varying(20)"); b.Property("TenantId") .IsRequired() .HasMaxLength(50) .HasColumnType("character varying(50)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); b.HasIndex("TenantId") .IsUnique(); b.ToTable("Tenants"); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("RoleId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("RoleId"); b.ToTable("AspNetRoleClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("integer"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ClaimType") .HasColumnType("text"); b.Property("ClaimValue") .HasColumnType("text"); b.Property("UserId") .HasColumnType("bigint"); b.HasKey("Id"); b.HasIndex("UserId"); b.ToTable("AspNetUserClaims", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.Property("LoginProvider") .HasColumnType("text"); b.Property("ProviderKey") .HasColumnType("text"); b.Property("ProviderDisplayName") .HasColumnType("text"); b.Property("UserId") .HasColumnType("bigint"); b.HasKey("LoginProvider", "ProviderKey"); b.HasIndex("UserId"); b.ToTable("AspNetUserLogins", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.Property("UserId") .HasColumnType("bigint"); b.Property("RoleId") .HasColumnType("bigint"); b.HasKey("UserId", "RoleId"); b.HasIndex("RoleId"); b.ToTable("AspNetUserRoles", (string)null); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.Property("UserId") .HasColumnType("bigint"); b.Property("LoginProvider") .HasColumnType("text"); b.Property("Name") .HasColumnType("text"); b.Property("Value") .HasColumnType("text"); b.HasKey("UserId", "LoginProvider", "Name"); b.ToTable("AspNetUserTokens", (string)null); }); modelBuilder.Entity("Fengling.AuthService.Models.ApplicationUser", b => { b.OwnsOne("Fengling.AuthService.Models.TenantInfo", "TenantInfo", b1 => { b1.Property("ApplicationUserId") .HasColumnType("bigint"); b1.Property("Id") .HasColumnType("bigint") .HasColumnName("TenantId"); b1.Property("Name") .IsRequired() .HasColumnType("text") .HasColumnName("TenantName"); b1.Property("TenantId") .IsRequired() .HasColumnType("text") .HasColumnName("TenantCode"); b1.HasKey("ApplicationUserId"); b1.ToTable("AspNetUsers"); b1.WithOwner() .HasForeignKey("ApplicationUserId"); }); b.Navigation("TenantInfo") .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim", b => { b.HasOne("Fengling.AuthService.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim", b => { b.HasOne("Fengling.AuthService.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin", b => { b.HasOne("Fengling.AuthService.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole", b => { b.HasOne("Fengling.AuthService.Models.ApplicationRole", null) .WithMany() .HasForeignKey("RoleId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); b.HasOne("Fengling.AuthService.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken", b => { b.HasOne("Fengling.AuthService.Models.ApplicationUser", null) .WithMany() .HasForeignKey("UserId") .OnDelete(DeleteBehavior.Cascade) .IsRequired(); }); #pragma warning restore 612, 618 } } }