1253 lines
43 KiB
C#
1253 lines
43 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using MiaoJiZhang.Infrastructure.Persistence;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Metadata;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
|
|
#nullable disable
|
|
|
|
namespace MiaoJiZhang.Infrastructure.Persistence.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
partial class AppDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.8")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 64);
|
|
|
|
MySqlModelBuilderExtensions.AutoIncrementColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AdminAuditLog", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Action")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("varchar(80)");
|
|
|
|
b.Property<long?>("AdminUserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Detail")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("varchar(1000)");
|
|
|
|
b.Property<string>("HttpMethod")
|
|
.IsRequired()
|
|
.HasMaxLength(12)
|
|
.HasColumnType("varchar(12)");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("Path")
|
|
.IsRequired()
|
|
.HasMaxLength(300)
|
|
.HasColumnType("varchar(300)");
|
|
|
|
b.Property<string>("Resource")
|
|
.IsRequired()
|
|
.HasMaxLength(120)
|
|
.HasColumnType("varchar(120)");
|
|
|
|
b.Property<int>("StatusCode")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("Success")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Username")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CreatedAt");
|
|
|
|
b.HasIndex("AdminUserId", "CreatedAt");
|
|
|
|
b.ToTable("AdminAuditLogs");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AdminSession", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("AbsoluteExpiresAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("AdminUserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("AuthVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("CsrfTokenHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<DateTime>("ExpiresAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("IpAddress")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<DateTime>("LastSeenAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("RevokedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("TokenHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("UserAgent")
|
|
.HasMaxLength(300)
|
|
.HasColumnType("varchar(300)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("TokenHash")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("AdminUserId", "RevokedAt", "ExpiresAt");
|
|
|
|
b.ToTable("AdminSessions");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AdminUser", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<int>("AuthVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("FailedLoginCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTime?>("LastLoginAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("LockedUntil")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("MustChangePassword")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("varchar(128)");
|
|
|
|
b.Property<string>("Role")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Username")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("IsActive", "Role");
|
|
|
|
b.ToTable("AdminUsers");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiAvatar", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("DefaultName")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ImageUrl")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("SpeechTic")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AiAvatars");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("AvatarKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("CustomName")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PersonaKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("ProactiveLevel")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("RoastLevel")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("StickerFrequency")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AiCompanionSettings");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiPersona", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Description")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("PromptTemplate")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("SampleLine")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("Version")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AiPersonas");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AppConfig", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("Version")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("AppConfigs");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasPrecision(12, 2)
|
|
.HasColumnType("decimal(12,2)");
|
|
|
|
b.Property<long?>("CategoryId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("LedgerId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("Period")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LedgerId", "Period", "CategoryId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Budgets");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.BudgetNotificationReceipt", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<long>("BudgetId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("Period")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Threshold")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId", "Period");
|
|
|
|
b.HasIndex("BudgetId", "Period", "Threshold")
|
|
.IsUnique();
|
|
|
|
b.ToTable("BudgetNotificationReceipts");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Category", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("ColorKey")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("varchar(32)");
|
|
|
|
b.Property<string>("IconKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long?>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.ToTable("Categories");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.ChatMessage", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Content")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("Role")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long?>("TransactionId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId", "CreatedAt");
|
|
|
|
b.ToTable("ChatMessages");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("IconKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsDefault")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<long>("OwnerId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("OwnerId");
|
|
|
|
b.ToTable("Ledgers");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushDelivery", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime?>("AcceptedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("AttemptCount")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("ErrorCode")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("ErrorMessage")
|
|
.HasMaxLength(400)
|
|
.HasColumnType("varchar(400)");
|
|
|
|
b.Property<DateTime?>("LeaseExpiresAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("LeaseId")
|
|
.HasMaxLength(36)
|
|
.HasColumnType("varchar(36)");
|
|
|
|
b.Property<DateTime>("NextAttemptAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Provider")
|
|
.IsRequired()
|
|
.HasMaxLength(16)
|
|
.HasColumnType("varchar(16)");
|
|
|
|
b.Property<string>("ProviderMessageId")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("varchar(128)");
|
|
|
|
b.Property<long>("PushDeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long>("PushMessageId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("State")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PushDeviceId");
|
|
|
|
b.HasIndex("PushMessageId", "PushDeviceId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("State", "NextAttemptAt", "LeaseExpiresAt");
|
|
|
|
b.ToTable("PushDeliveries");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushDevice", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("AppVersion")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("varchar(32)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("DisabledReason")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("Flavor")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<string>("InstallationId")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTime>("LastSeenAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("NotificationsAllowed")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("PackageName")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("varchar(128)");
|
|
|
|
b.Property<string>("Provider")
|
|
.IsRequired()
|
|
.HasMaxLength(16)
|
|
.HasColumnType("varchar(16)");
|
|
|
|
b.Property<string>("TokenCiphertext")
|
|
.IsRequired()
|
|
.HasMaxLength(6144)
|
|
.HasColumnType("varchar(6144)");
|
|
|
|
b.Property<string>("TokenHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("UnbindTokenHash")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<int>("VersionCode")
|
|
.HasColumnType("int");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LastSeenAt");
|
|
|
|
b.HasIndex("PackageName", "InstallationId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserId", "IsActive");
|
|
|
|
b.HasIndex("Provider", "PackageName", "TokenHash")
|
|
.IsUnique();
|
|
|
|
b.ToTable("PushDevices");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushMessage", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Action")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<string>("Body")
|
|
.IsRequired()
|
|
.HasMaxLength(240)
|
|
.HasColumnType("varchar(240)");
|
|
|
|
b.Property<DateTime?>("CancelledAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Category")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<DateTime?>("CompletedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("EntityId")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("Flavor")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<bool>("IsTest")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<int?>("MaxVersionCode")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int?>("MinVersionCode")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("ProviderFilter")
|
|
.HasMaxLength(16)
|
|
.HasColumnType("varchar(16)");
|
|
|
|
b.Property<string>("PublicId")
|
|
.IsRequired()
|
|
.HasMaxLength(36)
|
|
.HasColumnType("varchar(36)");
|
|
|
|
b.Property<DateTime?>("ScheduledAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Source")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<DateTime?>("StartedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("State")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<long?>("TargetUserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<long?>("TestDeviceId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("Title")
|
|
.IsRequired()
|
|
.HasMaxLength(80)
|
|
.HasColumnType("varchar(80)");
|
|
|
|
b.Property<int>("TtlSeconds")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PublicId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("State", "ScheduledAt");
|
|
|
|
b.HasIndex("TargetUserId", "CreatedAt");
|
|
|
|
b.ToTable("PushMessages");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Sticker", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("GroupKey")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("ImageUrl")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("Label")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("TriggerTags")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Stickers");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasPrecision(12, 2)
|
|
.HasColumnType("decimal(12,2)");
|
|
|
|
b.Property<long>("CategoryId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("ClientRequestId")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<string>("Counterparty")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("varchar(100)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("DeletedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("EvidenceFingerprint")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<bool>("IsDeleted")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<long>("LedgerId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("Note")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("OccurredAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("PaymentMethod")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Provider")
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<string>("ProviderTransactionId")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("varchar(128)");
|
|
|
|
b.Property<string>("RecognitionConfidence")
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<string>("RecognitionOccurrenceId")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("varchar(64)");
|
|
|
|
b.Property<int>("Source")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<long?>("SourceChatMessageId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.Property<string>("SourceText")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int?>("TransferDirection")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("LedgerId", "OccurredAt");
|
|
|
|
b.HasIndex("UserId", "ClientRequestId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserId", "IsDeleted");
|
|
|
|
b.HasIndex("UserId", "RecognitionOccurrenceId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("UserId", "Provider", "ProviderTransactionId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime?>("AccountClosureRequestedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<DateTime?>("AccountClosureScheduledAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("AiChatLimit")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AiChatPeriod")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<int>("AiChatUsed")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<DateTime>("AiChatWindowStartedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<int>("AppMode")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AppleUserId")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<int>("AuthVersion")
|
|
.HasColumnType("int");
|
|
|
|
b.Property<string>("AvatarUrl")
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Email")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<bool>("EmailVerified")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<bool>("IsBanned")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTime?>("LastLoginAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<string>("Nickname")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("varchar(32)");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasColumnType("longtext");
|
|
|
|
b.Property<string>("Phone")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<bool>("PhoneVerified")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("varchar(32)");
|
|
|
|
b.Property<string>("WeChatOpenId")
|
|
.HasColumnType("varchar(255)");
|
|
|
|
b.Property<string>("WeChatUnionId")
|
|
.HasColumnType("longtext");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountClosureScheduledAt");
|
|
|
|
b.HasIndex("Email")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Phone")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Username")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("WeChatOpenId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("Users");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserFeaturePermission", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<string>("PermissionKey")
|
|
.IsRequired()
|
|
.HasMaxLength(32)
|
|
.HasColumnType("varchar(32)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId", "PermissionKey")
|
|
.IsUnique();
|
|
|
|
b.ToTable("UserFeaturePermissions");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserPushPreference", b =>
|
|
{
|
|
b.Property<long>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("bigint");
|
|
|
|
MySqlPropertyBuilderExtensions.UseMySqlIdentityColumn(b.Property<long>("Id"));
|
|
|
|
b.Property<string>("Category")
|
|
.IsRequired()
|
|
.HasMaxLength(24)
|
|
.HasColumnType("varchar(24)");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("tinyint(1)");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("datetime(6)");
|
|
|
|
b.Property<long>("UserId")
|
|
.HasColumnType("bigint");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId", "Category")
|
|
.IsUnique();
|
|
|
|
b.ToTable("UserPushPreferences");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AdminSession", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.AdminUser", "AdminUser")
|
|
.WithMany("Sessions")
|
|
.HasForeignKey("AdminUserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("AdminUser");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AiCompanionSetting", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "User")
|
|
.WithOne("AiCompanion")
|
|
.HasForeignKey("MiaoJiZhang.Domain.Entities.AiCompanionSetting", "UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Budget", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger")
|
|
.WithMany("Budgets")
|
|
.HasForeignKey("LedgerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Ledger");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.BudgetNotificationReceipt", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.Budget", "Budget")
|
|
.WithMany()
|
|
.HasForeignKey("BudgetId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Budget");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "Owner")
|
|
.WithMany("Ledgers")
|
|
.HasForeignKey("OwnerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Owner");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushDelivery", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.PushDevice", "PushDevice")
|
|
.WithMany("Deliveries")
|
|
.HasForeignKey("PushDeviceId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.PushMessage", "PushMessage")
|
|
.WithMany("Deliveries")
|
|
.HasForeignKey("PushMessageId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PushDevice");
|
|
|
|
b.Navigation("PushMessage");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushDevice", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "User")
|
|
.WithMany("PushDevices")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Transaction", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.Ledger", "Ledger")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("LedgerId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Ledger");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserFeaturePermission", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "User")
|
|
.WithMany("FeaturePermissions")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.UserPushPreference", b =>
|
|
{
|
|
b.HasOne("MiaoJiZhang.Domain.Entities.User", "User")
|
|
.WithMany("PushPreferences")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.AdminUser", b =>
|
|
{
|
|
b.Navigation("Sessions");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.Ledger", b =>
|
|
{
|
|
b.Navigation("Budgets");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushDevice", b =>
|
|
{
|
|
b.Navigation("Deliveries");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.PushMessage", b =>
|
|
{
|
|
b.Navigation("Deliveries");
|
|
});
|
|
|
|
modelBuilder.Entity("MiaoJiZhang.Domain.Entities.User", b =>
|
|
{
|
|
b.Navigation("AiCompanion");
|
|
|
|
b.Navigation("FeaturePermissions");
|
|
|
|
b.Navigation("Ledgers");
|
|
|
|
b.Navigation("PushDevices");
|
|
|
|
b.Navigation("PushPreferences");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|