# ledger_account_current_balance

## Description

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

```sql
CREATE TABLE `ledger_account_current_balance` (
  `ledger_account_current_balance_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `ledger_account_id` mediumint unsigned NOT NULL,
  `account_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_current_balance_id`),
  UNIQUE KEY `uidx_account_id` (`account_id`),
  KEY `fk_ledger_account_current_balance_ledger_account_` (`ledger_account_id`),
  KEY `fk_ledger_account_current_balance_account` (`account_id`),
  CONSTRAINT `fk_ledger_account_current_balance_account` FOREIGN KEY (`account_id`) REFERENCES `account` (`account_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `fk_ledger_account_current_balance_ledger_account_` FOREIGN KEY (`ledger_account_id`) REFERENCES `ledger_account` (`ledger_account_id`) ON DELETE CASCADE ON UPDATE CASCADE
) 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)               |         |
| created_at                        | datetime           |         | false    |                  |          |                                     |         |
| created_by                        | varchar(255)       |         | false    |                  |          |                                     |         |
| last_modified                     | datetime           |         | false    |                  |          |                                     |         |
| last_modified_by                  | varchar(255)       |         | false    |                  |          |                                     |         |
| ledger_account_current_balance_id | mediumint unsigned |         | false    | auto_increment   |          |                                     |         |
| ledger_account_id                 | mediumint unsigned |         | false    |                  |          | [ledger_account](ledger_account.md) |         |

## Constraints

| Name                                              | Type        | Definition                                                                    |
| ------------------------------------------------- | ----------- | ----------------------------------------------------------------------------- |
| PRIMARY                                           | PRIMARY KEY | PRIMARY KEY (ledger_account_current_balance_id)                               |
| fk_ledger_account_current_balance_account         | FOREIGN KEY | FOREIGN KEY (account_id) REFERENCES account (account_id)                      |
| fk_ledger_account_current_balance_ledger_account_ | FOREIGN KEY | FOREIGN KEY (ledger_account_id) REFERENCES ledger_account (ledger_account_id) |
| uidx_account_id                                   | UNIQUE      | UNIQUE KEY uidx_account_id (account_id)                                       |

## Indexes

| Name                                              | Definition                                                                            |
| ------------------------------------------------- | ------------------------------------------------------------------------------------- |
| PRIMARY                                           | PRIMARY KEY (ledger_account_current_balance_id) USING BTREE                           |
| fk_ledger_account_current_balance_account         | KEY fk_ledger_account_current_balance_account (account_id) USING BTREE                |
| fk_ledger_account_current_balance_ledger_account_ | KEY fk_ledger_account_current_balance_ledger_account_ (ledger_account_id) USING BTREE |
| uidx_account_id                                   | UNIQUE KEY uidx_account_id (account_id) USING BTREE                                   |

## Relations

![er](ledger_account_current_balance.svg)

---

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