Table: Ledger_Entry_Application
Columns
NameTypeConstraintsDescription
ledger_entry_application_KEYintNOT NULLAUTO-INCREMENT: Database assigned primary key for this table
row_versiontimestampNOT NULL
update__staff_KEYintNOT NULL
update_date_utcdatetimeNOT NULL
from__ledger_entry_KEYintNOT NULLThe Ledger Entry that amount_applied is subtracted from.
to__ledger_entry_KEYintNOT NULLThe Ledger Entry that amount_applied is added to.
applied_amountdecimal (17, 2)NOT NULLThe amount of "from" entry that is applied to "to"
create_date_utcdatetimeNOT NULL
Primary key
NameColumnsDescription
PK_Ledger_Entry_Application$ledger_entry_application_KEYledger_entry_application_KEYCLUSTERED
Unique constraints
NameColumnsDescription
UK_Ledger_Entry_Application$from__ledger_entry_KEY$to__ledger_entry_KEYfrom__ledger_entry_KEY, to__ledger_entry_KEYOnly one application is allowed between two Ledger_Entry records.
Indexes
NameColumnsDescription
IX_Ledger_Entry_Application$from__ledger_entry_KEY$to__ledger_entry_KEY$applied_amountfrom__ledger_entry_KEY, to__ledger_entry_KEY, applied_amount
IX_Ledger_Entry_Application$to__ledger_entry_KEY$from__ledger_entry_KEY$applied_amountto__ledger_entry_KEY, from__ledger_entry_KEY, applied_amount
Foreign keys
NameColumnsReferenced tableDescription
FK_Ledger_Entry_Application__Ledger_Entry__from__ledger_entry_KEYfrom__ledger_entry_KEYLedger_Entry
FK_Ledger_Entry_Application__Ledger_Entry__to__ledger_entry_KEYto__ledger_entry_KEYLedger_Entry

Schema diagram