# organization_members_history

## Description

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

```sql
CREATE TABLE `organization_members_history` (
  `organization_member_event_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `organization_id` bigint(20) NOT NULL,
  `member_user_id` bigint(20) NOT NULL,
  `added` tinyint(1) NOT NULL,
  `created_at` datetime(6) NOT NULL,
  PRIMARY KEY (`organization_member_event_id`),
  KEY `fk_organization_members_history_member_user_id` (`member_user_id`),
  KEY `fk_organization_members_history_organization_id` (`organization_id`),
  CONSTRAINT `fk_organization_members_history_member_user_id` FOREIGN KEY (`member_user_id`) REFERENCES `users` (`user_id`) ON DELETE CASCADE,
  CONSTRAINT `fk_organization_members_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_member_event_id | bigint(20) |  | false | auto_increment |  |  |  |
| organization_id | bigint(20) |  | false |  |  | [organizations](organizations.md) |  |
| member_user_id | bigint(20) |  | false |  |  | [users](users.md) |  |
| added | tinyint(1) |  | false |  |  |  |  |
| created_at | datetime(6) |  | false |  |  |  |  |

## Constraints

| Name | Type | Definition |
| ---- | ---- | ---------- |
| fk_organization_members_history_member_user_id | FOREIGN KEY | FOREIGN KEY (member_user_id) REFERENCES users (user_id) |
| fk_organization_members_history_organization_id | FOREIGN KEY | FOREIGN KEY (organization_id) REFERENCES organizations (organization_id) |
| PRIMARY | PRIMARY KEY | PRIMARY KEY (organization_member_event_id) |

## Indexes

| Name | Definition |
| ---- | ---------- |
| fk_organization_members_history_member_user_id | KEY fk_organization_members_history_member_user_id (member_user_id) USING BTREE |
| fk_organization_members_history_organization_id | KEY fk_organization_members_history_organization_id (organization_id) USING BTREE |
| PRIMARY | PRIMARY KEY (organization_member_event_id) USING BTREE |

## Relations

![er](organization_members_history.svg)

---

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