0b6ff8faf1
Creates all database tables: users, accounts, transactions, categories, payees, budgets, scheduled_transactions, loans, investments, reconciliations, plugins, and import batches. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1144 lines
40 KiB
C#
1144 lines
40 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
using Purrse.Data;
|
|
|
|
#nullable disable
|
|
|
|
namespace Purrse.Data.Migrations
|
|
{
|
|
[DbContext(typeof(PurrseDbContext))]
|
|
partial class PurrseDbContextModelSnapshot : ModelSnapshot
|
|
{
|
|
protected override void BuildModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasAnnotation("ProductVersion", "9.0.6")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Account", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AccountNumber")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<decimal>("Balance")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal?>("CreditLimit")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<string>("Institution")
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<decimal?>("InterestRate")
|
|
.HasPrecision(8, 4)
|
|
.HasColumnType("numeric(8,4)");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsClosed")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("accounts", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.AmortizationEntry", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("EscrowAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<decimal>("InterestAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<Guid>("LoanDetailId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("PaymentAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<DateTime>("PaymentDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("PaymentNumber")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<decimal>("PrincipalAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<decimal>("RemainingBalance")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("LoanDetailId");
|
|
|
|
b.ToTable("amortization_entries", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Budget", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Month")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("Notes")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("Year")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("UserId", "Year", "Month")
|
|
.IsUnique();
|
|
|
|
b.ToTable("budgets", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.BudgetItem", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("BudgetId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("BudgetedAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<Guid>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("BudgetId");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.ToTable("budget_items", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Category", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<bool>("IsSystem")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<Guid?>("ParentId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("SortOrder")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("ParentId");
|
|
|
|
b.HasIndex("UserId", "Name", "ParentId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("categories", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.ImportBatch", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("DuplicateCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<string>("FileName")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("FileType")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<DateTime>("ImportedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("ImportedCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("SkippedCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("TotalCount")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("import_batches", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.InvestmentHolding", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("AsOfDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal>("CostBasis")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<Guid>("SecurityId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("Shares")
|
|
.HasPrecision(18, 6)
|
|
.HasColumnType("numeric(18,6)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.HasIndex("SecurityId");
|
|
|
|
b.ToTable("investment_holdings", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.LoanDetail", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("EscrowAmount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<decimal?>("ExtraPayment")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<decimal>("InterestRate")
|
|
.HasPrecision(8, 4)
|
|
.HasColumnType("numeric(8,4)");
|
|
|
|
b.Property<DateTime>("MaturityDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal>("MonthlyPayment")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<decimal>("OriginalBalance")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<DateTime>("OriginationDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("TermMonths")
|
|
.HasColumnType("integer");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("loan_details", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Payee", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("DefaultCategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(300)
|
|
.HasColumnType("character varying(300)");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("DefaultCategoryId");
|
|
|
|
b.HasIndex("UserId", "Name")
|
|
.IsUnique();
|
|
|
|
b.ToTable("payees", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PayeeAlias", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Alias")
|
|
.IsRequired()
|
|
.HasMaxLength(300)
|
|
.HasColumnType("character varying(300)");
|
|
|
|
b.Property<Guid>("PayeeId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Alias");
|
|
|
|
b.HasIndex("PayeeId");
|
|
|
|
b.ToTable("payee_aliases", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PluginConfiguration", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Key")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<Guid>("PluginRegistrationId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Value")
|
|
.IsRequired()
|
|
.HasMaxLength(2000)
|
|
.HasColumnType("character varying(2000)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PluginRegistrationId", "Key")
|
|
.IsUnique();
|
|
|
|
b.ToTable("plugin_configurations", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PluginRegistration", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("EntryAssembly")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<string>("EntryType")
|
|
.IsRequired()
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<DateTime>("InstalledAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsEnabled")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<string>("PluginId")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<string>("Version")
|
|
.IsRequired()
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PluginId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("plugin_registrations", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Reconciliation", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime?>("CompletedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<bool>("IsCompleted")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<decimal>("StatementBalance")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<DateTime>("StatementDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.ToTable("reconciliations", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.ScheduledTransaction", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<bool>("AutoPost")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<Guid?>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime?>("EndDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<int>("Frequency")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<bool>("IsActive")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Memo")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<DateTime>("NextDueDate")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<Guid?>("PayeeId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PayeeName")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<int>("ReminderDaysBefore")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid>("UserId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("PayeeId");
|
|
|
|
b.HasIndex("UserId");
|
|
|
|
b.ToTable("scheduled_transactions", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Security", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(200)
|
|
.HasColumnType("character varying(200)");
|
|
|
|
b.Property<string>("SecurityType")
|
|
.HasMaxLength(50)
|
|
.HasColumnType("character varying(50)");
|
|
|
|
b.Property<string>("Symbol")
|
|
.IsRequired()
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Symbol")
|
|
.IsUnique();
|
|
|
|
b.ToTable("securities", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.SecurityPrice", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal>("Price")
|
|
.HasPrecision(18, 4)
|
|
.HasColumnType("numeric(18,4)");
|
|
|
|
b.Property<Guid>("SecurityId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("SecurityId", "Date")
|
|
.IsUnique();
|
|
|
|
b.ToTable("security_prices", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Transaction", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("AccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<Guid?>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("CheckNumber")
|
|
.HasMaxLength(20)
|
|
.HasColumnType("character varying(20)");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTime>("Date")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Fingerprint")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("FitId")
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<Guid?>("ImportBatchId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<bool>("IsVoid")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("Memo")
|
|
.HasMaxLength(1000)
|
|
.HasColumnType("character varying(1000)");
|
|
|
|
b.Property<Guid?>("PayeeId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PayeeName")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<Guid?>("ReconciliationId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("ReferenceNumber")
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.Property<int>("Status")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<Guid?>("TransferTransactionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<int>("Type")
|
|
.HasColumnType("integer");
|
|
|
|
b.Property<DateTime>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("AccountId");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("Date");
|
|
|
|
b.HasIndex("Fingerprint");
|
|
|
|
b.HasIndex("FitId");
|
|
|
|
b.HasIndex("ImportBatchId");
|
|
|
|
b.HasIndex("PayeeId");
|
|
|
|
b.HasIndex("ReconciliationId");
|
|
|
|
b.HasIndex("TransferTransactionId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("transactions", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.TransactionSplit", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasPrecision(18, 2)
|
|
.HasColumnType("numeric(18,2)");
|
|
|
|
b.Property<Guid?>("CategoryId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("Memo")
|
|
.HasMaxLength(500)
|
|
.HasColumnType("character varying(500)");
|
|
|
|
b.Property<Guid>("TransactionId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("CategoryId");
|
|
|
|
b.HasIndex("TransactionId");
|
|
|
|
b.ToTable("transaction_splits", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.User", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<DateTime>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Email")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<DateTime?>("LastLoginAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PasswordHash")
|
|
.IsRequired()
|
|
.HasMaxLength(255)
|
|
.HasColumnType("character varying(255)");
|
|
|
|
b.Property<string>("RefreshToken")
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTime?>("RefreshTokenExpiresAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Username")
|
|
.IsRequired()
|
|
.HasMaxLength(100)
|
|
.HasColumnType("character varying(100)");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("Email")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("Username")
|
|
.IsUnique();
|
|
|
|
b.ToTable("users", (string)null);
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Account", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany("Accounts")
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.AmortizationEntry", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.LoanDetail", "LoanDetail")
|
|
.WithMany("AmortizationEntries")
|
|
.HasForeignKey("LoanDetailId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("LoanDetail");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Budget", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.BudgetItem", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Budget", "Budget")
|
|
.WithMany("Items")
|
|
.HasForeignKey("BudgetId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Purrse.Core.Models.Category", "Category")
|
|
.WithMany("BudgetItems")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Budget");
|
|
|
|
b.Navigation("Category");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Category", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Category", "Parent")
|
|
.WithMany("Children")
|
|
.HasForeignKey("ParentId")
|
|
.OnDelete(DeleteBehavior.Restrict);
|
|
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Parent");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.ImportBatch", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithMany()
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.InvestmentHolding", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithMany("InvestmentHoldings")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Purrse.Core.Models.Security", "Security")
|
|
.WithMany("Holdings")
|
|
.HasForeignKey("SecurityId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Security");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.LoanDetail", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithOne("LoanDetail")
|
|
.HasForeignKey("Purrse.Core.Models.LoanDetail", "AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Payee", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Category", "DefaultCategory")
|
|
.WithMany()
|
|
.HasForeignKey("DefaultCategoryId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("DefaultCategory");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PayeeAlias", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Payee", "Payee")
|
|
.WithMany("Aliases")
|
|
.HasForeignKey("PayeeId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Payee");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PluginConfiguration", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.PluginRegistration", "PluginRegistration")
|
|
.WithMany("Configurations")
|
|
.HasForeignKey("PluginRegistrationId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PluginRegistration");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Reconciliation", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithMany("Reconciliations")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Account");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.ScheduledTransaction", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithMany()
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Purrse.Core.Models.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.Payee", "Payee")
|
|
.WithMany()
|
|
.HasForeignKey("PayeeId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.User", "User")
|
|
.WithMany()
|
|
.HasForeignKey("UserId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Payee");
|
|
|
|
b.Navigation("User");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.SecurityPrice", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Security", "Security")
|
|
.WithMany("Prices")
|
|
.HasForeignKey("SecurityId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Security");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Transaction", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Account", "Account")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("AccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Purrse.Core.Models.Category", "Category")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.ImportBatch", "ImportBatch")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("ImportBatchId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.Payee", "Payee")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("PayeeId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.Reconciliation", "Reconciliation")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("ReconciliationId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.Transaction", "TransferTransaction")
|
|
.WithOne()
|
|
.HasForeignKey("Purrse.Core.Models.Transaction", "TransferTransactionId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("Account");
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("ImportBatch");
|
|
|
|
b.Navigation("Payee");
|
|
|
|
b.Navigation("Reconciliation");
|
|
|
|
b.Navigation("TransferTransaction");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.TransactionSplit", b =>
|
|
{
|
|
b.HasOne("Purrse.Core.Models.Category", "Category")
|
|
.WithMany()
|
|
.HasForeignKey("CategoryId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Purrse.Core.Models.Transaction", "Transaction")
|
|
.WithMany("Splits")
|
|
.HasForeignKey("TransactionId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("Category");
|
|
|
|
b.Navigation("Transaction");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Account", b =>
|
|
{
|
|
b.Navigation("InvestmentHoldings");
|
|
|
|
b.Navigation("LoanDetail");
|
|
|
|
b.Navigation("Reconciliations");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Budget", b =>
|
|
{
|
|
b.Navigation("Items");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Category", b =>
|
|
{
|
|
b.Navigation("BudgetItems");
|
|
|
|
b.Navigation("Children");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.ImportBatch", b =>
|
|
{
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.LoanDetail", b =>
|
|
{
|
|
b.Navigation("AmortizationEntries");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Payee", b =>
|
|
{
|
|
b.Navigation("Aliases");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.PluginRegistration", b =>
|
|
{
|
|
b.Navigation("Configurations");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Reconciliation", b =>
|
|
{
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Security", b =>
|
|
{
|
|
b.Navigation("Holdings");
|
|
|
|
b.Navigation("Prices");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.Transaction", b =>
|
|
{
|
|
b.Navigation("Splits");
|
|
});
|
|
|
|
modelBuilder.Entity("Purrse.Core.Models.User", b =>
|
|
{
|
|
b.Navigation("Accounts");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|