# 培訓中心資料庫規格
# Schema Documentation
## Table: `course_categories`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類型 |
| `slug` | VARCHAR(255) | | NULL | 別名 |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `title` | VARCHAR(255) | | NULL | 標題 |
| `content` | TEXT | | NULL | 內容 |
| `is_defaulted` | TINYINT(1) | Not null | | 是否預設 |
| `type` | VARCHAR(255) | Not null | cms | 類別 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `course_categories_slug_unique` | `slug` | UNIQUE | |
## Table: `course_groups`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `course_category_id` | BIGINT UNSIGNED | Not null | | |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `youtube` | VARCHAR(255) | Not null | | youtube網址 |
| `period` | VARCHAR(255) | Not null | | 幾年期 |
| `content` | VARCHAR(255) | Not null | | 內容 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `course_tag`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `course_id` | BIGINT UNSIGNED | Not null | | |
| `tag_id` | BIGINT UNSIGNED | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `course_tag_course_id_tag_id_index` | `course_id`, `tag_id` | INDEX | |
## Table: `courses`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `course_category_id` | BIGINT UNSIGNED | Not null | | |
| `name` | VARCHAR(255) | Not null | | 課程名稱 |
| `registration_deadline` | DATETIME | Not null | | 報名截止日 |
| `start_date` | DATETIME | Not null | | 開始日期 |
| `end_date` | DATETIME | Not null | | 結束日期 |
| `period` | VARCHAR(255) | | NULL | 上課時段 |
| `location` | VARCHAR(255) | | NULL | 地點 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `is_ended` | TINYINT(1) | Not null | | 是否結束報名 |
| `is_published` | TINYINT(1) | Not null | 1 | 是否發布 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `experiences`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類型 |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `teacher_id` | BIGINT UNSIGNED | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `homes`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類型 |
| `title` | VARCHAR(255) | Not null | | 標題 |
| `content` | TEXT | | NULL | 內容 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `is_published` | TINYINT(1) | Not null | 1 | 是否發布 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `info_categories`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類型 |
| `title` | VARCHAR(255) | Not null | | 標題 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `infos`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `info_category_id` | BIGINT UNSIGNED | Not null | | |
| `title` | VARCHAR(255) | Not null | | 標題 |
| `content` | TEXT | | NULL | 內容 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `media`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類別 |
| `model_id` | BIGINT UNSIGNED | Not null | | 物件id |
| `uuid` | CHAR(36) | | NULL | |
| `collection_name` | VARCHAR(255) | Not null | | 檔案類別 |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `file_name` | VARCHAR(255) | Not null | | 檔案名稱 |
| `mime_type` | VARCHAR(255) | | NULL | |
| `disk` | VARCHAR(255) | Not null | | |
| `conversions_disk` | VARCHAR(255) | | NULL | |
| `size` | BIGINT UNSIGNED | Not null | | |
| `manipulations` | JSON | Not null | | |
| `custom_properties` | JSON | Not null | | |
| `generated_conversions` | JSON | Not null | | |
| `responsive_images` | JSON | Not null | | |
| `order_column` | INT UNSIGNED | | NULL | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `media_uuid_unique` | `uuid` | UNIQUE | |
| `media_model_type_model_id_index` | `model_type`, `model_id` | INDEX | |
## Table: `node_tags`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `node_id` | BIGINT UNSIGNED | Not null | | |
| `tag_id` | BIGINT UNSIGNED | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `node_tags_node_id_tag_id_index` | `node_id`, `tag_id` | INDEX | |
## Table: `nodes`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `parent_id` | BIGINT UNSIGNED | | NULL | 上層id |
| `slug` | VARCHAR(255) | | NULL | 別名 |
| `name` | VARCHAR(255) | | NULL | 名稱 |
| `title` | VARCHAR(255) | | NULL | 標題 |
| `content` | TEXT | | NULL | 內容 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `youtube` | VARCHAR(255) | | NULL | youtube連結 |
| `is_external` | TINYINT(1) | Not null | | 是否外部連結 |
| `is_published` | TINYINT(1) | Not null | | 是否發布 |
| `is_defaulted` | TINYINT(1) | Not null | | 是否預設 |
| `list_type` | VARCHAR(255) | Not null | list | 版型 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `nodes_slug_unique` | `slug` | UNIQUE | |
## Table: `other_course_categories`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | 物件類型 |
| `description` | TEXT | | NULL | 描述 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `other_course_tag`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `other_course_id` | BIGINT UNSIGNED | Not null | | |
| `tag_id` | BIGINT UNSIGNED | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `other_course_tag_other_course_id_tag_id_index` | `other_course_id`, `tag_id` | INDEX | |
## Table: `other_courses`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `registration_deadline` | DATETIME | Not null | | 報名截止日 |
| `start_date` | DATETIME | Not null | | 開始日期 |
| `end_date` | DATETIME | Not null | | 結束日期 |
| `period` | VARCHAR(255) | | NULL | 時段 |
| `location` | VARCHAR(255) | | NULL | 地點 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `is_ended` | TINYINT(1) | Not null | | 是否報名截止 |
| `is_published` | TINYINT(1) | Not null | 1 | 是否發布 |
| `content` | TEXT | | NULL | 內容 |
| `info` | TEXT | | NULL | 資訊 |
| `phone` | VARCHAR(255) | | NULL | 電話 |
| `email` | VARCHAR(255) | | NULL | email |
| `memo` | TEXT | | NULL | 備註 |
| `other_course_category_id` | BIGINT UNSIGNED | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `other_teachers`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `other_course_id` | BIGINT UNSIGNED | Not null | | |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `introduction` | TEXT | | NULL | 介紹 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `password_records`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `user_id` | BIGINT UNSIGNED | Not null | | |
| `password` | VARCHAR(255) | Not null | | 密碼 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `redactor_images`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `imageable_type` | VARCHAR(255) | | NULL | |
| `imageable_id` | INT UNSIGNED | | NULL | |
| `name` | VARCHAR(255) | Not null | | |
| `url` | VARCHAR(255) | Not null | | |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
## Table: `schools`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `name` | VARCHAR(255) | Not null | | |
| `introduction` | VARCHAR(255) | Not null | | 名稱 |
| `address` | VARCHAR(255) | Not null | | 介紹 |
| `phone` | VARCHAR(255) | Not null | | 電話 |
| `youtube` | VARCHAR(255) | | NULL | youtube連結 |
| `panorama` | VARCHAR(255) | | NULL | 環景 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `tags`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `model_type` | VARCHAR(255) | Not null | | |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `teacher_categories`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `course_category_id` | BIGINT UNSIGNED | Not null | | |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `teachers`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `teacher_category_id` | BIGINT UNSIGNED | Not null | | |
| `school_id` | BIGINT UNSIGNED | | NULL | 學校id |
| `name` | VARCHAR(255) | Not null | | 名稱 |
| `order` | INT UNSIGNED | Not null | | 排序 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
| `content` | TEXT | | NULL | 內容 |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
## Table: `users`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `name` | VARCHAR(255) | Not null | | 姓名 |
| `email` | VARCHAR(255) | Not null | | email |
| `email_verify_token` | VARCHAR(255) | | NULL | |
| `email_verified_at` | TIMESTAMP | | NULL | |
| `password` | VARCHAR(255) | Not null | | 密碼 |
| `remember_token` | VARCHAR(100) | | NULL | |
| `last_logged_at` | TIMESTAMP | | NULL | 最後登入時間 |
| `last_logged_ip` | VARCHAR(255) | NULL | | 最後登入ip |
| `password_expired_at` | TIMESTAMP | | NULL | 密碼過期時間 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |
| `users_email_unique` | `email` | UNIQUE | |
| `users_email_verify_token_unique` | `email_verify_token` | UNIQUE | |
## Table: `wishing_ponds`
### Description:
### Columns:
| Column | Data Type | Attributes | Default | Description |
| --- | --- | --- | --- | --- |
| `id` | BIGINT UNSIGNED | Primary, Auto increment, Not null | | |
| `first_name` | VARCHAR(255) | | NULL | 名 |
| `last_name` | VARCHAR(255) | Not null | | 姓 |
| `gender` | VARCHAR(255) | Not null | | 性別 |
| `phone` | VARCHAR(255) | | NULL | 電話 |
| `email` | VARCHAR(255) | | NULL | email |
| `class_name` | VARCHAR(255) | Not null | | 課程名稱 |
| `outline` | VARCHAR(255) | | NULL | 大綱 |
| `achievement` | VARCHAR(255) | Not null | collecting | 達成狀態 |
| `link` | VARCHAR(255) | | NULL | 連結 |
| `is_published` | TINYINT(1) | Not null | 1 | 是否發布 |
| `quantity` | INT | Not null | | 願望數 |
| `created_at` | TIMESTAMP | | NULL | |
| `updated_at` | TIMESTAMP | | NULL | |
### Indices:
| Name | Columns | Type | Description |
| --- | --- | --- | --- |
| `PRIMARY` | `id` | PRIMARY | |