Table: Ledger_Entry_Application
Columns
Name | Type | Constraints | Description
ledger_entry_application_KEY | int | NOT NULL | AUTO-INCREMENT: Database assigned primary key for this table
row_version | timestamp | NOT NULL |
update__staff_KEY | int | NOT NULL |
update_date | datetime | NOT NULL |
from__ledger_entry_KEY | int | NOT NULL | The Ledger Entry that amount_applied is subtracted from.
to__ledger_entry_KEY | int | NOT NULL | The Ledger Entry that amount_applied is added to.
applied_amount | decimal (17, 2) | NOT NULL | The amount of "from" entry that is applied to "to"
create_date | datetime | NOT NULL |

Primary key
Name | Columns | Description
PK_Ledger_Entry_Application$ledger_entry_application_KEY | ledger_entry_application_KEY | CLUSTERED
Unique constraints
Name | Columns | Description
UK_Ledger_Entry_Application__from__ledger_entry_KEY__to__ledger_entry_KEY | from__ledger_entry_KEY, to__ledger_entry_KEY | Only one application is allowed between two Ledger_Entry records.
Indexes
Name | Columns | Description
IX_Ledger_Entry_Application$from__ledger_entry_KEY$to__ledger_entry_KEY$applied_amount | from__ledger_entry_KEY, to__ledger_entry_KEY, applied_amount |
IX_Ledger_Entry_Application$to__ledger_entry_KEY$from__ledger_entry_KEY$applied_amount | to__ledger_entry_KEY, from__ledger_entry_KEY, applied_amount |

Foreign keys
Name | Columns | Referenced table | Description
FK_Ledger_Entry_Application__Ledger_Entry__from__ledger_entry_KEY | from__ledger_entry_KEY | Ledger_Entry |
FK_Ledger_Entry_Application__Ledger_Entry__to__ledger_entry_KEY | to__ledger_entry_KEY | Ledger_Entry |