# contract_mechanical_deduction_history

## Description

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

```sql
CREATE TABLE `contract_mechanical_deduction_history` (
  `contract_mechanical_deduction_history_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `contract_mechanical_deduction_id` mediumint unsigned NOT NULL,
  `contract_id` mediumint unsigned NOT NULL,
  `territory` enum('USA','CAN','ROW') COLLATE utf8mb4_general_ci NOT NULL,
  `mechanical_type` set('digital','physical','ringtone') COLLATE utf8mb4_general_ci NOT NULL,
  `admin_type` enum('both','business','customer') COLLATE utf8mb4_general_ci NOT NULL,
  `admin_fee` decimal(5,2) DEFAULT NULL,
  `created_by` varchar(180) COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` datetime NOT NULL,
  `last_modified_by` varchar(180) COLLATE utf8mb4_general_ci NOT NULL,
  `last_modified` datetime NOT NULL,
  `deleted_by` varchar(180) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `deleted_at` datetime DEFAULT NULL,
  PRIMARY KEY (`contract_mechanical_deduction_history_id`)
) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
```

</details>

## Columns

| Name                                     | Type                                 | Default | Nullable | Extra Definition | Children | Parents                                                           | Comment |
| ---------------------------------------- | ------------------------------------ | ------- | -------- | ---------------- | -------- | ----------------------------------------------------------------- | ------- |
| admin_fee                                | decimal(5,2)                         |         | true     |                  |          |                                                                   |         |
| admin_type                               | enum('both','business','customer')   |         | false    |                  |          |                                                                   |         |
| contract_id                              | mediumint unsigned                   |         | false    |                  |          | [contract](contract.md)                                           |         |
| contract_mechanical_deduction_history_id | mediumint unsigned                   |         | false    | auto_increment   |          |                                                                   |         |
| contract_mechanical_deduction_id         | mediumint unsigned                   |         | false    |                  |          | [contract_mechanical_deduction](contract_mechanical_deduction.md) |         |
| created_at                               | datetime                             |         | false    |                  |          |                                                                   |         |
| created_by                               | varchar(180)                         |         | false    |                  |          |                                                                   |         |
| deleted_at                               | datetime                             |         | true     |                  |          |                                                                   |         |
| deleted_by                               | varchar(180)                         |         | true     |                  |          |                                                                   |         |
| last_modified                            | datetime                             |         | false    |                  |          |                                                                   |         |
| last_modified_by                         | varchar(180)                         |         | false    |                  |          |                                                                   |         |
| mechanical_type                          | set('digital','physical','ringtone') |         | false    |                  |          |                                                                   |         |
| territory                                | enum('USA','CAN','ROW')              |         | false    |                  |          |                                                                   |         |

## Constraints

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

## Indexes

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

## Relations

![er](contract_mechanical_deduction_history.svg)

---

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