# report_custom

## Description

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

```sql
CREATE TABLE `report_custom` (
  `report_custom_id` mediumint unsigned NOT NULL AUTO_INCREMENT,
  `account_id` mediumint unsigned NOT NULL,
  `contract_id` mediumint unsigned DEFAULT NULL,
  `subaccount_id` int DEFAULT NULL,
  `statement_period_ids` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `revenue_type` enum('distribution','neighbouring_rights') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'distribution',
  `report_custom_status` enum('in_progress','complete','error') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'in_progress',
  `dimension_row` enum('product','statement_period','service','recording','territory','product_artist','collection_society','transaction_type','track','imprint','subaccount') COLLATE utf8mb4_general_ci NOT NULL,
  `dimension_column` enum('territory','statement_period','financial_detail') COLLATE utf8mb4_general_ci NOT NULL,
  `number_format` enum('us','eu') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'us',
  `file_type` enum('csv','xls','txt') COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'csv',
  `file_location` varchar(255) COLLATE utf8mb4_general_ci DEFAULT NULL,
  `created_by` varchar(255) COLLATE utf8mb4_general_ci NOT NULL,
  `created_at` datetime NOT NULL,
  PRIMARY KEY (`report_custom_id`),
  KEY `fk_report_custom_account` (`account_id`),
  CONSTRAINT `fk_report_custom_account` FOREIGN KEY (`account_id`) REFERENCES `account` (`account_id`) ON DELETE RESTRICT ON UPDATE RESTRICT
) 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 |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ | -------- | ---------------- | -------- | ----------------------- | ------- |
| account_id           | mediumint unsigned                                                                                                                                           |              | false    |                  |          | [account](account.md)   |         |
| contract_id          | mediumint unsigned                                                                                                                                           |              | true     |                  |          | [contract](contract.md) |         |
| created_at           | datetime                                                                                                                                                     |              | false    |                  |          |                         |         |
| created_by           | varchar(255)                                                                                                                                                 |              | false    |                  |          |                         |         |
| dimension_column     | enum('territory','statement_period','financial_detail')                                                                                                      |              | false    |                  |          |                         |         |
| dimension_row        | enum('product','statement_period','service','recording','territory','product_artist','collection_society','transaction_type','track','imprint','subaccount') |              | false    |                  |          |                         |         |
| file_location        | varchar(255)                                                                                                                                                 |              | true     |                  |          |                         |         |
| file_type            | enum('csv','xls','txt')                                                                                                                                      | csv          | false    |                  |          |                         |         |
| number_format        | enum('us','eu')                                                                                                                                              | us           | false    |                  |          |                         |         |
| report_custom_id     | mediumint unsigned                                                                                                                                           |              | false    | auto_increment   |          |                         |         |
| report_custom_status | enum('in_progress','complete','error')                                                                                                                       | in_progress  | false    |                  |          |                         |         |
| revenue_type         | enum('distribution','neighbouring_rights')                                                                                                                   | distribution | false    |                  |          |                         |         |
| statement_period_ids | varchar(255)                                                                                                                                                 |              | false    |                  |          |                         |         |
| subaccount_id        | int                                                                                                                                                          |              | true     |                  |          |                         |         |

## Constraints

| Name                     | Type        | Definition                                               |
| ------------------------ | ----------- | -------------------------------------------------------- |
| PRIMARY                  | PRIMARY KEY | PRIMARY KEY (report_custom_id)                           |
| fk_report_custom_account | FOREIGN KEY | FOREIGN KEY (account_id) REFERENCES account (account_id) |

## Indexes

| Name                     | Definition                                            |
| ------------------------ | ----------------------------------------------------- |
| PRIMARY                  | PRIMARY KEY (report_custom_id) USING BTREE            |
| fk_report_custom_account | KEY fk_report_custom_account (account_id) USING BTREE |

## Relations

![er](report_custom.svg)

---

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