569 lines
21 KiB
C#
569 lines
21 KiB
C#
// <auto-generated />
|
|
using System;
|
|
using Asentrafin.Api.Data;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Microsoft.EntityFrameworkCore.Infrastructure;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
|
|
|
|
#nullable disable
|
|
|
|
namespace Asentrafin.Api.Data.Migrations
|
|
{
|
|
[DbContext(typeof(AppDbContext))]
|
|
[Migration("20260707005627_AddPlaidIngestion")]
|
|
partial class AddPlaidIngestion
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void BuildTargetModel(ModelBuilder modelBuilder)
|
|
{
|
|
#pragma warning disable 612, 618
|
|
modelBuilder
|
|
.HasDefaultSchema("app")
|
|
.HasAnnotation("ProductVersion", "10.0.9")
|
|
.HasAnnotation("Relational:MaxIdentifierLength", 63);
|
|
|
|
NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder);
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidAccount", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("AvailableBalance")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateTimeOffset?>("BalanceLastUpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal?>("CurrentBalance")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("IsoCurrencyCode")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<decimal?>("Limit")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("Mask")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("OfficialName")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<string>("PlaidAccountId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<Guid>("PlaidItemId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("RawJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("Subtype")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Type")
|
|
.IsRequired()
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("UnofficialCurrencyCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidAccountId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("PlaidItemId");
|
|
|
|
b.ToTable("plaid_accounts", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidHolding", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("CostBasis")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<decimal?>("InstitutionPrice")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateOnly?>("InstitutionPriceAsOf")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<decimal?>("InstitutionValue")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("IsoCurrencyCode")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<Guid>("PlaidAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlaidItemId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlaidSecurityId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("RawJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("UnofficialCurrencyCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidItemId");
|
|
|
|
b.HasIndex("PlaidSecurityId");
|
|
|
|
b.HasIndex("PlaidAccountId", "PlaidSecurityId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("plaid_holdings", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidInvestmentTransaction", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AccountPlaidId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateOnly>("Date")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<decimal?>("Fees")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("IsoCurrencyCode")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<Guid?>("PlaidAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PlaidInvestmentTransactionId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<Guid>("PlaidItemId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid?>("PlaidSecurityId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("Price")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<decimal>("Quantity")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<string>("RawJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("SecurityPlaidId")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("Subtype")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("Type")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("UnofficialCurrencyCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidAccountId");
|
|
|
|
b.HasIndex("PlaidInvestmentTransactionId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("PlaidSecurityId");
|
|
|
|
b.HasIndex("PlaidItemId", "Date");
|
|
|
|
b.ToTable("plaid_investment_transactions", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidItem", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AccessToken")
|
|
.IsRequired()
|
|
.HasColumnType("text");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("InstitutionId")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("InstitutionName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<DateTimeOffset?>("LastAccountsSyncedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset?>("LastInvestmentsSyncedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateTimeOffset?>("LastTransactionsSyncedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("PlaidItemId")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("TransactionsCursor")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidItemId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("plaid_items", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidSecurity", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<decimal?>("ClosePrice")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateOnly?>("ClosePriceAsOf")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("Cusip")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("Isin")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("IsoCurrencyCode")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<string>("Name")
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<string>("PlaidSecurityId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("RawJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<string>("Sedol")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("TickerSymbol")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<string>("Type")
|
|
.HasMaxLength(64)
|
|
.HasColumnType("character varying(64)");
|
|
|
|
b.Property<string>("UnofficialCurrencyCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidSecurityId")
|
|
.IsUnique();
|
|
|
|
b.ToTable("plaid_securities", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidTransaction", b =>
|
|
{
|
|
b.Property<Guid>("Id")
|
|
.ValueGeneratedOnAdd()
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("AccountPlaidId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<decimal>("Amount")
|
|
.HasColumnType("numeric");
|
|
|
|
b.Property<DateOnly?>("AuthorizedDate")
|
|
.HasColumnType("date");
|
|
|
|
b.PrimitiveCollection<string[]>("Categories")
|
|
.IsRequired()
|
|
.HasColumnType("text[]");
|
|
|
|
b.Property<DateTimeOffset>("CreatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<DateOnly>("Date")
|
|
.HasColumnType("date");
|
|
|
|
b.Property<string>("IsoCurrencyCode")
|
|
.HasMaxLength(8)
|
|
.HasColumnType("character varying(8)");
|
|
|
|
b.Property<string>("MerchantName")
|
|
.HasMaxLength(256)
|
|
.HasColumnType("character varying(256)");
|
|
|
|
b.Property<string>("Name")
|
|
.IsRequired()
|
|
.HasMaxLength(512)
|
|
.HasColumnType("character varying(512)");
|
|
|
|
b.Property<bool>("Pending")
|
|
.HasColumnType("boolean");
|
|
|
|
b.Property<string>("PersonalFinanceCategoryDetailed")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("PersonalFinanceCategoryPrimary")
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<Guid?>("PlaidAccountId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<Guid>("PlaidItemId")
|
|
.HasColumnType("uuid");
|
|
|
|
b.Property<string>("PlaidTransactionId")
|
|
.IsRequired()
|
|
.HasMaxLength(128)
|
|
.HasColumnType("character varying(128)");
|
|
|
|
b.Property<string>("RawJson")
|
|
.IsRequired()
|
|
.HasColumnType("jsonb");
|
|
|
|
b.Property<DateTimeOffset?>("RemovedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.Property<string>("UnofficialCurrencyCode")
|
|
.HasMaxLength(32)
|
|
.HasColumnType("character varying(32)");
|
|
|
|
b.Property<DateTimeOffset>("UpdatedAt")
|
|
.HasColumnType("timestamp with time zone");
|
|
|
|
b.HasKey("Id");
|
|
|
|
b.HasIndex("PlaidAccountId");
|
|
|
|
b.HasIndex("PlaidTransactionId")
|
|
.IsUnique();
|
|
|
|
b.HasIndex("PlaidItemId", "Date");
|
|
|
|
b.ToTable("plaid_transactions", "app");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidAccount", b =>
|
|
{
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidItem", "PlaidItem")
|
|
.WithMany("Accounts")
|
|
.HasForeignKey("PlaidItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PlaidItem");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidHolding", b =>
|
|
{
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidAccount", "PlaidAccount")
|
|
.WithMany("Holdings")
|
|
.HasForeignKey("PlaidAccountId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidItem", "PlaidItem")
|
|
.WithMany("Holdings")
|
|
.HasForeignKey("PlaidItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidSecurity", "PlaidSecurity")
|
|
.WithMany("Holdings")
|
|
.HasForeignKey("PlaidSecurityId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PlaidAccount");
|
|
|
|
b.Navigation("PlaidItem");
|
|
|
|
b.Navigation("PlaidSecurity");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidInvestmentTransaction", b =>
|
|
{
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidAccount", "PlaidAccount")
|
|
.WithMany("InvestmentTransactions")
|
|
.HasForeignKey("PlaidAccountId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidItem", "PlaidItem")
|
|
.WithMany("InvestmentTransactions")
|
|
.HasForeignKey("PlaidItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidSecurity", "PlaidSecurity")
|
|
.WithMany("InvestmentTransactions")
|
|
.HasForeignKey("PlaidSecurityId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.Navigation("PlaidAccount");
|
|
|
|
b.Navigation("PlaidItem");
|
|
|
|
b.Navigation("PlaidSecurity");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidTransaction", b =>
|
|
{
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidAccount", "PlaidAccount")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("PlaidAccountId")
|
|
.OnDelete(DeleteBehavior.SetNull);
|
|
|
|
b.HasOne("Asentrafin.Api.Entities.PlaidItem", "PlaidItem")
|
|
.WithMany("Transactions")
|
|
.HasForeignKey("PlaidItemId")
|
|
.OnDelete(DeleteBehavior.Cascade)
|
|
.IsRequired();
|
|
|
|
b.Navigation("PlaidAccount");
|
|
|
|
b.Navigation("PlaidItem");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidAccount", b =>
|
|
{
|
|
b.Navigation("Holdings");
|
|
|
|
b.Navigation("InvestmentTransactions");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidItem", b =>
|
|
{
|
|
b.Navigation("Accounts");
|
|
|
|
b.Navigation("Holdings");
|
|
|
|
b.Navigation("InvestmentTransactions");
|
|
|
|
b.Navigation("Transactions");
|
|
});
|
|
|
|
modelBuilder.Entity("Asentrafin.Api.Entities.PlaidSecurity", b =>
|
|
{
|
|
b.Navigation("Holdings");
|
|
|
|
b.Navigation("InvestmentTransactions");
|
|
});
|
|
#pragma warning restore 612, 618
|
|
}
|
|
}
|
|
}
|