# organization_calendars_history

## Description

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

```sql
CREATE TABLE `organization_calendars_history` (
  `organization_calendar_event_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `organization_id` bigint(20) NOT NULL,
  `calendar_id` bigint(20) NOT NULL,
  `admin_user_id` bigint(20) DEFAULT NULL,
  `added` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  PRIMARY KEY (`organization_calendar_event_id`),
  KEY `fk_organization_calendars_history_admin_user_id` (`admin_user_id`),
  KEY `fk_organization_calendars_history_calendar_id` (`calendar_id`),
  KEY `fk_organization_calendars_history_organization_id` (`organization_id`),
  CONSTRAINT `fk_organization_calendars_history_admin_user_id` FOREIGN KEY (`admin_user_id`) REFERENCES `users` (`user_id`) ON DELETE SET NULL,
  CONSTRAINT `fk_organization_calendars_history_calendar_id` FOREIGN KEY (`calendar_id`) REFERENCES `calendars` (`calendar_id`) ON DELETE CASCADE,
  CONSTRAINT `fk_organization_calendars_history_organization_id` FOREIGN KEY (`organization_id`) REFERENCES `organizations` (`organization_id`) ON DELETE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=[Redacted by tbls] DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
```

</details>

## Columns

| Name | Type | Default | Nullable | Extra Definition | Children | Parents | Comment |
| ---- | ---- | ------- | -------- | ---------------- | -------- | ------- | ------- |
| organization_calendar_event_id | bigint(20) |  | false | auto_increment |  |  |  |
| organization_id | bigint(20) |  | false |  |  | [organizations](organizations.md) |  |
| calendar_id | bigint(20) |  | false |  |  | [calendars](calendars.md) |  |
| admin_user_id | bigint(20) | NULL | true |  |  | [users](users.md) |  |
| added | tinyint(1) |  | false |  |  |  |  |
| created_at | datetime(6) |  | false |  |  |  |  |

## Constraints

| Name | Type | Definition |
| ---- | ---- | ---------- |
| fk_organization_calendars_history_admin_user_id | FOREIGN KEY | FOREIGN KEY (admin_user_id) REFERENCES users (user_id) |
| fk_organization_calendars_history_calendar_id | FOREIGN KEY | FOREIGN KEY (calendar_id) REFERENCES calendars (calendar_id) |
| fk_organization_calendars_history_organization_id | FOREIGN KEY | FOREIGN KEY (organization_id) REFERENCES organizations (organization_id) |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (organization_calendar_event_id) |

## Indexes

| Name | Definition |
| ---- | ---------- |
| fk_organization_calendars_history_admin_user_id | KEY fk_organization_calendars_history_admin_user_id (admin_user_id) USING BTREE |
| fk_organization_calendars_history_calendar_id | KEY fk_organization_calendars_history_calendar_id (calendar_id) USING BTREE |
| fk_organization_calendars_history_organization_id | KEY fk_organization_calendars_history_organization_id (organization_id) USING BTREE |
| PRIMARY | PRIMARY KEY (organization_calendar_event_id) USING BTREE |

## Relations

![er](organization_calendars_history.svg)

---

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