# ledger_account_contract_current_balance

## Description

<details>
<summary><strong>Table Definition</strong></summary>

```sql
CREATE TABLE `ledger_account_contract_current_balance` (
  `ledger_account_contract_current_balance_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `ledger_account_contract_id` mediumint unsigned NOT NULL,
  `account_id` mediumint unsigned NOT NULL,
  `contract_id` mediumint unsigned NOT NULL,
  `created_by` varchar(255) NOT NULL,
  `created_at` datetime NOT NULL,
  `last_modified_by` varchar(255) NOT NULL,
  `last_modified` datetime NOT NULL,
  PRIMARY KEY (`ledger_account_contract_current_balance_id`),
  UNIQUE KEY `uidx_contract_id` (`contract_id`),
  KEY `fk_ledger_account_contract_current_balance_ledger_` (`ledger_account_contract_id`),
  KEY `fk_ledger_account_contract_current_balance_account` (`account_id`),
  KEY `fk_ledger_account_contract_current_balance_contract` (`contract_id`),
  CONSTRAINT `fk_ledger_account_contract_current_balance_account` FOREIGN KEY (`account_id`) REFERENCES `account` (`account_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_ledger_account_contract_current_balance_contract` FOREIGN KEY (`contract_id`) REFERENCES `contract` (`contract_id`) ON DELETE RESTRICT ON UPDATE RESTRICT,
  CONSTRAINT `fk_ledger_account_contract_current_balance_ledger_` FOREIGN KEY (`ledger_account_contract_id`) REFERENCES `ledger_account_contract` (`ledger_account_contract_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb3
```

</details>

## Columns

| Name                                       | Type               | Default | Nullable | Extra Definition | Children | Parents                                               | Comment |
| ------------------------------------------ | ------------------ | ------- | -------- | ---------------- | -------- | ----------------------------------------------------- | ------- |
| account_id                                 | mediumint unsigned |         | false    |                  |          | [account](account.md)                                 |         |
| contract_id                                | mediumint unsigned |         | false    |                  |          | [contract](contract.md)                               |         |
| created_at                                 | datetime           |         | false    |                  |          |                                                       |         |
| created_by                                 | varchar(255)       |         | false    |                  |          |                                                       |         |
| last_modified                              | datetime           |         | false    |                  |          |                                                       |         |
| last_modified_by                           | varchar(255)       |         | false    |                  |          |                                                       |         |
| ledger_account_contract_current_balance_id | mediumint unsigned |         | false    | auto_increment   |          |                                                       |         |
| ledger_account_contract_id                 | mediumint unsigned |         | false    |                  |          | [ledger_account_contract](ledger_account_contract.md) |         |

## Constraints

| Name                                                | Type        | Definition                                                                                               |
| --------------------------------------------------- | ----------- | -------------------------------------------------------------------------------------------------------- |
| PRIMARY                                             | PRIMARY KEY | PRIMARY KEY (ledger_account_contract_current_balance_id)                                                 |
| fk_ledger_account_contract_current_balance_account  | FOREIGN KEY | FOREIGN KEY (account_id) REFERENCES account (account_id)                                                 |
| fk_ledger_account_contract_current_balance_contract | FOREIGN KEY | FOREIGN KEY (contract_id) REFERENCES contract (contract_id)                                              |
| fk_ledger_account_contract_current_balance_ledger_  | FOREIGN KEY | FOREIGN KEY (ledger_account_contract_id) REFERENCES ledger_account_contract (ledger_account_contract_id) |
| uidx_contract_id                                    | UNIQUE      | UNIQUE KEY uidx_contract_id (contract_id)                                                                |

## Indexes

| Name                                                | Definition                                                                                      |
| --------------------------------------------------- | ----------------------------------------------------------------------------------------------- |
| PRIMARY                                             | PRIMARY KEY (ledger_account_contract_current_balance_id) USING BTREE                            |
| fk_ledger_account_contract_current_balance_account  | KEY fk_ledger_account_contract_current_balance_account (account_id) USING BTREE                 |
| fk_ledger_account_contract_current_balance_contract | KEY fk_ledger_account_contract_current_balance_contract (contract_id) USING BTREE               |
| fk_ledger_account_contract_current_balance_ledger_  | KEY fk_ledger_account_contract_current_balance_ledger_ (ledger_account_contract_id) USING BTREE |
| uidx_contract_id                                    | UNIQUE KEY uidx_contract_id (contract_id) USING BTREE                                           |

## Relations

![er](ledger_account_contract_current_balance.svg)

---

> Generated by [tbls](https://github.com/k1LoW/tbls)
