// using System; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Migrations; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; using TakeoutSaaS.Infrastructure.Logs.Persistence; #nullable disable namespace TakeoutSaaS.Infrastructure.Migrations.LogsDb { [DbContext(typeof(TakeoutLogsDbContext))] [Migration("20251226091835_InitLogsDb")] partial class InitLogsDb { /// protected override void BuildTargetModel(ModelBuilder modelBuilder) { #pragma warning disable 612, 618 modelBuilder .HasAnnotation("ProductVersion", "10.0.0") .HasAnnotation("Relational:MaxIdentifierLength", 63); NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); modelBuilder.Entity("TakeoutSaaS.Domain.Membership.Entities.MemberGrowthLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasComment("实体唯一标识。"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("ChangeValue") .HasColumnType("integer") .HasComment("变动数量。"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasComment("创建时间(UTC)。"); b.Property("CreatedBy") .HasColumnType("bigint") .HasComment("创建人用户标识,匿名或系统操作时为 null。"); b.Property("CurrentValue") .HasColumnType("integer") .HasComment("当前成长值。"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone") .HasComment("软删除时间(UTC),未删除时为 null。"); b.Property("DeletedBy") .HasColumnType("bigint") .HasComment("删除人用户标识(软删除),未删除时为 null。"); b.Property("MemberId") .HasColumnType("bigint") .HasComment("会员标识。"); b.Property("Notes") .HasMaxLength(256) .HasColumnType("character varying(256)") .HasComment("备注。"); b.Property("OccurredAt") .HasColumnType("timestamp with time zone") .HasComment("发生时间。"); b.Property("TenantId") .HasColumnType("bigint") .HasComment("所属租户 ID。"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone") .HasComment("最近一次更新时间(UTC),从未更新时为 null。"); b.Property("UpdatedBy") .HasColumnType("bigint") .HasComment("最后更新人用户标识,匿名或系统操作时为 null。"); b.HasKey("Id"); b.HasIndex("TenantId", "MemberId", "OccurredAt"); b.ToTable("member_growth_logs", null, t => { t.HasComment("成长值变动日志。"); }); }); modelBuilder.Entity("TakeoutSaaS.Domain.Merchants.Entities.MerchantAuditLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasComment("实体唯一标识。"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Action") .HasColumnType("integer") .HasComment("动作类型。"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasComment("创建时间(UTC)。"); b.Property("CreatedBy") .HasColumnType("bigint") .HasComment("创建人用户标识,匿名或系统操作时为 null。"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone") .HasComment("软删除时间(UTC),未删除时为 null。"); b.Property("DeletedBy") .HasColumnType("bigint") .HasComment("删除人用户标识(软删除),未删除时为 null。"); b.Property("Description") .HasMaxLength(1024) .HasColumnType("character varying(1024)") .HasComment("详情描述。"); b.Property("MerchantId") .HasColumnType("bigint") .HasComment("商户标识。"); b.Property("OperatorId") .HasColumnType("bigint") .HasComment("操作人 ID。"); b.Property("OperatorName") .HasMaxLength(64) .HasColumnType("character varying(64)") .HasComment("操作人名称。"); b.Property("TenantId") .HasColumnType("bigint") .HasComment("所属租户 ID。"); b.Property("Title") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)") .HasComment("标题。"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone") .HasComment("最近一次更新时间(UTC),从未更新时为 null。"); b.Property("UpdatedBy") .HasColumnType("bigint") .HasComment("最后更新人用户标识,匿名或系统操作时为 null。"); b.HasKey("Id"); b.HasIndex("TenantId", "MerchantId"); b.ToTable("merchant_audit_logs", null, t => { t.HasComment("商户入驻审核日志。"); }); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.OperationLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasComment("实体唯一标识。"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasComment("创建时间(UTC)。"); b.Property("CreatedBy") .HasColumnType("bigint") .HasComment("创建人用户标识,匿名或系统操作时为 null。"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone") .HasComment("软删除时间(UTC),未删除时为 null。"); b.Property("DeletedBy") .HasColumnType("bigint") .HasComment("删除人用户标识(软删除),未删除时为 null。"); b.Property("OperationType") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)") .HasComment("操作类型:BatchExtend, BatchRemind, StatusChange 等。"); b.Property("OperatorId") .HasMaxLength(64) .HasColumnType("character varying(64)") .HasComment("操作人ID。"); b.Property("OperatorName") .HasMaxLength(128) .HasColumnType("character varying(128)") .HasComment("操作人名称。"); b.Property("Parameters") .HasColumnType("text") .HasComment("操作参数(JSON)。"); b.Property("Result") .HasColumnType("text") .HasComment("操作结果(JSON)。"); b.Property("Success") .HasColumnType("boolean") .HasComment("是否成功。"); b.Property("TargetIds") .HasColumnType("text") .HasComment("目标ID列表(JSON)。"); b.Property("TargetType") .IsRequired() .HasMaxLength(64) .HasColumnType("character varying(64)") .HasComment("目标类型:Subscription, Bill 等。"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone") .HasComment("最近一次更新时间(UTC),从未更新时为 null。"); b.Property("UpdatedBy") .HasColumnType("bigint") .HasComment("最后更新人用户标识,匿名或系统操作时为 null。"); b.HasKey("Id"); b.HasIndex("CreatedAt"); b.HasIndex("OperationType", "CreatedAt"); b.ToTable("operation_logs", null, t => { t.HasComment("运营操作日志。"); }); }); modelBuilder.Entity("TakeoutSaaS.Domain.Tenants.Entities.TenantAuditLog", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("bigint") .HasComment("实体唯一标识。"); NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); b.Property("Action") .HasColumnType("integer") .HasComment("操作类型。"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone") .HasComment("创建时间(UTC)。"); b.Property("CreatedBy") .HasColumnType("bigint") .HasComment("创建人用户标识,匿名或系统操作时为 null。"); b.Property("CurrentStatus") .HasColumnType("integer") .HasComment("新状态。"); b.Property("DeletedAt") .HasColumnType("timestamp with time zone") .HasComment("软删除时间(UTC),未删除时为 null。"); b.Property("DeletedBy") .HasColumnType("bigint") .HasComment("删除人用户标识(软删除),未删除时为 null。"); b.Property("Description") .HasMaxLength(1024) .HasColumnType("character varying(1024)") .HasComment("详细描述。"); b.Property("OperatorId") .HasColumnType("bigint") .HasComment("操作人 ID。"); b.Property("OperatorName") .HasMaxLength(64) .HasColumnType("character varying(64)") .HasComment("操作人名称。"); b.Property("PreviousStatus") .HasColumnType("integer") .HasComment("原状态。"); b.Property("TenantId") .HasColumnType("bigint") .HasComment("关联的租户标识。"); b.Property("Title") .IsRequired() .HasMaxLength(128) .HasColumnType("character varying(128)") .HasComment("日志标题。"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone") .HasComment("最近一次更新时间(UTC),从未更新时为 null。"); b.Property("UpdatedBy") .HasColumnType("bigint") .HasComment("最后更新人用户标识,匿名或系统操作时为 null。"); b.HasKey("Id"); b.HasIndex("TenantId"); b.ToTable("tenant_audit_logs", null, t => { t.HasComment("租户运营审核日志。"); }); }); #pragma warning restore 612, 618 } } }