# tax_withholding_override

## Description

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

```sql
CREATE TABLE `tax_withholding_override` (
  `tax_withholding_override_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `account_payee_id` mediumint unsigned NOT NULL,
  `rate_override` decimal(5,2) DEFAULT NULL,
  `certificate_expiration_date` date DEFAULT NULL,
  `message` text,
  `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 (`tax_withholding_override_id`),
  UNIQUE KEY `account_payee_id` (`account_payee_id`),
  CONSTRAINT `fk_tax_withholding_override_account_payee_id` FOREIGN KEY (`account_payee_id`) REFERENCES `account_payee` (`account_payee_id`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci
```

</details>

## Columns

| Name                        | Type               | Default | Nullable | Extra Definition | Children                                                                | Parents                           | Comment |
| --------------------------- | ------------------ | ------- | -------- | ---------------- | ----------------------------------------------------------------------- | --------------------------------- | ------- |
| account_payee_id            | mediumint unsigned |         | false    |                  |                                                                         | [account_payee](account_payee.md) |         |
| certificate_expiration_date | date               |         | true     |                  |                                                                         |                                   |         |
| created_at                  | datetime           |         | false    |                  |                                                                         |                                   |         |
| created_by                  | varchar(255)       |         | false    |                  |                                                                         |                                   |         |
| last_modified               | datetime           |         | false    |                  |                                                                         |                                   |         |
| last_modified_by            | varchar(255)       |         | false    |                  |                                                                         |                                   |         |
| message                     | text               |         | true     |                  |                                                                         |                                   |         |
| rate_override               | decimal(5,2)       |         | true     |                  |                                                                         |                                   |         |
| tax_withholding_override_id | mediumint unsigned |         | false    | auto_increment   | [tax_withholding_override_history](tax_withholding_override_history.md) |                                   |         |

## Constraints

| Name                                         | Type        | Definition                                                                 |
| -------------------------------------------- | ----------- | -------------------------------------------------------------------------- |
| PRIMARY                                      | PRIMARY KEY | PRIMARY KEY (tax_withholding_override_id)                                  |
| account_payee_id                             | UNIQUE      | UNIQUE KEY account_payee_id (account_payee_id)                             |
| fk_tax_withholding_override_account_payee_id | FOREIGN KEY | FOREIGN KEY (account_payee_id) REFERENCES account_payee (account_payee_id) |

## Indexes

| Name             | Definition                                                 |
| ---------------- | ---------------------------------------------------------- |
| PRIMARY          | PRIMARY KEY (tax_withholding_override_id) USING BTREE      |
| account_payee_id | UNIQUE KEY account_payee_id (account_payee_id) USING BTREE |

## Triggers

| Name                                  | Definition                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| after_update_tax_withholding_override | CREATE TRIGGER after_update_tax_withholding_override AFTER UPDATE ON tax_withholding_override<br />FOR EACH ROW<br />BEGIN<br />    INSERT INTO `tax_withholding_override_history`<br />        (<br />            `tax_withholding_override_id`, <br />            `account_payee_id`, <br />            `rate_override`, <br />            `certificate_expiration_date`, <br />            `message`,<br />            `created_by`,<br />            `created_at`,<br />            `last_modified_by`,<br />            `last_modified`<br />        )<br />    VALUES<br />        (<br />            OLD.tax_withholding_override_id, <br />            OLD.account_payee_id, <br />            OLD.rate_override, <br />            OLD.certificate_expiration_date, <br />            OLD.message,<br />            OLD.created_by,<br />            OLD.created_at,<br />            OLD.last_modified_by,<br />            OLD.last_modified<br />        );<br />END |

## Relations

![er](tax_withholding_override.svg)

---

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