# contract_flowthrough_history

## Description

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

```sql
CREATE TABLE `contract_flowthrough_history` (
  `contract_flowthrough_history_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `contract_flowthrough_id` mediumint unsigned NOT NULL,
  `contract_id` mediumint unsigned NOT NULL,
  `reference_flowthrough_calculation_id` tinyint unsigned NOT NULL,
  `flowthrough_rate` decimal(5,2) NOT NULL,
  `flowthrough_status` enum('active','shutoff','paused') NOT NULL DEFAULT 'active',
  `has_automatic_shutoff` tinyint(1) NOT NULL DEFAULT '1',
  `recoupment_cap` bigint DEFAULT NULL,
  `previous_flowthrough_status` enum('active','shutoff','paused') DEFAULT NULL,
  `status_last_modified_by` varchar(180) DEFAULT NULL,
  `status_last_modified` datetime DEFAULT NULL,
  `created_by` varchar(180) NOT NULL,
  `created_at` datetime NOT NULL,
  `last_modified_by` varchar(180) NOT NULL,
  `last_modified` datetime NOT NULL,
  `deleted_by` varchar(180) DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`contract_flowthrough_history_id`)
) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
```

</details>

## Columns

| Name                                 | Type                              | Default | Nullable | Extra Definition | Children | Parents                                                                   | Comment |
| ------------------------------------ | --------------------------------- | ------- | -------- | ---------------- | -------- | ------------------------------------------------------------------------- | ------- |
| contract_flowthrough_history_id      | mediumint unsigned                |         | false    | auto_increment   |          |                                                                           |         |
| contract_flowthrough_id              | mediumint unsigned                |         | false    |                  |          | [contract_flowthrough](contract_flowthrough.md)                           |         |
| contract_id                          | mediumint unsigned                |         | false    |                  |          | [contract](contract.md)                                                   |         |
| created_at                           | datetime                          |         | false    |                  |          |                                                                           |         |
| created_by                           | varchar(180)                      |         | false    |                  |          |                                                                           |         |
| deleted_at                           | datetime                          |         | true     |                  |          |                                                                           |         |
| deleted_by                           | varchar(180)                      |         | true     |                  |          |                                                                           |         |
| flowthrough_rate                     | decimal(5,2)                      |         | false    |                  |          |                                                                           |         |
| flowthrough_status                   | enum('active','shutoff','paused') | active  | false    |                  |          |                                                                           |         |
| has_automatic_shutoff                | tinyint(1)                        | 1       | false    |                  |          |                                                                           |         |
| last_modified                        | datetime                          |         | false    |                  |          |                                                                           |         |
| last_modified_by                     | varchar(180)                      |         | false    |                  |          |                                                                           |         |
| previous_flowthrough_status          | enum('active','shutoff','paused') |         | true     |                  |          |                                                                           |         |
| recoupment_cap                       | bigint                            |         | true     |                  |          |                                                                           |         |
| reference_flowthrough_calculation_id | tinyint unsigned                  |         | false    |                  |          | [reference_flowthrough_calculation](reference_flowthrough_calculation.md) |         |
| status_last_modified                 | datetime                          |         | true     |                  |          |                                                                           |         |
| status_last_modified_by              | varchar(180)                      |         | true     |                  |          |                                                                           |         |

## Constraints

| Name    | Type        | Definition                                    |
| ------- | ----------- | --------------------------------------------- |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (contract_flowthrough_history_id) |

## Indexes

| Name    | Definition                                                |
| ------- | --------------------------------------------------------- |
| PRIMARY | PRIMARY KEY (contract_flowthrough_history_id) USING BTREE |

## Relations

![er](contract_flowthrough_history.svg)

---

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