ADSFFDAS
Tables (31)
ai_job_document_versions
- ai_job_document_version_id — BIGINT — Primary key — NOT NULL
- ai_job_id — BIGINT — Foreign key → ai_jobs.ai_job_id — NOT NULL
- document_version_id — BIGINT — Foreign key → document_versions.document_version_id — NOT NULL
ai_jobs
- ai_job_id — BIGINT — Primary key — NOT NULL
- job_type — VARCHAR(50) — NOT NULL
- status — VARCHAR(30) — NOT NULL
- requested_by — BIGINT — Foreign key → users.user_id
- retry_count — INT — NOT NULL
- parent_job_id — BIGINT — Foreign key → ai_jobs.ai_job_id
- failure_stage — VARCHAR(100)
- failure_reason — TEXT
- requested_at — DATETIME — NOT NULL
- started_at — DATETIME
- completed_at — DATETIME
audit_logs
- audit_log_id — BIGINT — Primary key — NOT NULL
- actor_id — BIGINT — Foreign key → users.user_id
- action_type — VARCHAR(50) — NOT NULL
- target_type — VARCHAR(50) — NOT NULL
- target_id — BIGINT — NOT NULL
- before_data — JSON
- after_data — JSON
- request_ip — VARCHAR(45)
- created_at — DATETIME — NOT NULL
departments
- department_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — VARCHAR(500)
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
document_chunks
- document_chunk_id — BIGINT — Primary key — NOT NULL
- document_version_id — BIGINT — Foreign key → document_versions.document_version_id — NOT NULL
- chunk_index — INT — NOT NULL
- page_number — INT
- section_title — VARCHAR(255)
- content — TEXT — NOT NULL
- start_offset — INT
- end_offset — INT
- created_at — DATETIME — NOT NULL
document_classification_tags
- classification_tag_id — BIGINT — Primary key — NOT NULL
- classification_id — BIGINT — Foreign key → document_classifications.classification_id — NOT NULL
- tag_id — BIGINT — Foreign key → tags.tag_id — NOT NULL
document_classifications
- classification_id — BIGINT — Primary key — NOT NULL
- document_version_id — BIGINT — Foreign key → document_versions.document_version_id — NOT NULL
- department_id — BIGINT — Foreign key → departments.department_id
- job_position_id — BIGINT — Foreign key → job_positions.job_position_id
- document_type_id — BIGINT — Foreign key → document_types.document_type_id
- classification_source — VARCHAR(30) — NOT NULL
- approval_status — VARCHAR(30) — NOT NULL
- confidence_score — DECIMAL(5,4)
- classified_at — DATETIME — NOT NULL
- reviewed_by — BIGINT — Foreign key → users.user_id
- reviewed_at — DATETIME
- rejection_reason — VARCHAR(1000)
document_department_permissions
- document_department_permission_id — BIGINT — Primary key — NOT NULL
- document_id — BIGINT — Foreign key → documents.document_id — NOT NULL
- department_id — BIGINT — Foreign key → departments.department_id — NOT NULL
- created_at — DATETIME — NOT NULL
document_role_permissions
- document_role_permission_id — BIGINT — Primary key — NOT NULL
- document_id — BIGINT — Foreign key → documents.document_id — NOT NULL
- role_id — BIGINT — Foreign key → roles.role_id — NOT NULL
- created_at — DATETIME — NOT NULL
document_types
- document_type_id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(50) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — VARCHAR(500)
document_versions
- document_version_id — BIGINT — Primary key — NOT NULL
- document_id — BIGINT — Foreign key → documents.document_id — NOT NULL
- version_number — INT — NOT NULL
- original_filename — VARCHAR(255) — NOT NULL
- stored_filename — VARCHAR(255) — NOT NULL
- storage_path — VARCHAR(1000) — NOT NULL
- file_extension — VARCHAR(20) — NOT NULL
- mime_type — VARCHAR(100) — NOT NULL
- file_size — BIGINT — NOT NULL
- checksum — VARCHAR(128)
- parsing_status — VARCHAR(30) — NOT NULL
- parsing_failure_reason — TEXT
- extracted_text — LONGTEXT
- uploaded_at — DATETIME — NOT NULL
- parsed_at — DATETIME
documents
- document_id — BIGINT — Primary key — NOT NULL
- uploader_id — BIGINT — Foreign key → users.user_id — NOT NULL
- title — VARCHAR(255) — NOT NULL
- description — TEXT
- visibility_status — VARCHAR(30) — NOT NULL
- latest_version_number — INT — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
- restorable_until — DATETIME
job_positions
- job_position_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — VARCHAR(500)
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
notifications
- notification_id — BIGINT — Primary key — NOT NULL
- recipient_id — BIGINT — Foreign key → users.user_id — NOT NULL
- notification_type — VARCHAR(50) — NOT NULL
- title — VARCHAR(255) — NOT NULL
- message — VARCHAR(1000) — NOT NULL
- target_type — VARCHAR(50)
- target_id — BIGINT
- read_status — VARCHAR(20) — NOT NULL
- created_at — DATETIME — NOT NULL
- read_at — DATETIME
question_document_sources
- question_document_source_id — BIGINT — Primary key — NOT NULL
- question_id — BIGINT — Foreign key → questions.question_id — NOT NULL
- document_chunk_id — BIGINT — Foreign key → document_chunks.document_chunk_id — NOT NULL
- source_order — INT — NOT NULL
- relevance_score — DECIMAL(5,4)
question_feedbacks
- question_feedback_id — BIGINT — Primary key — NOT NULL
- question_id — BIGINT — Foreign key → questions.question_id — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- feedback_type — VARCHAR(30) — NOT NULL
- feedback_comment — VARCHAR(1000)
- created_at — DATETIME — NOT NULL
question_wiki_sources
- question_wiki_source_id — BIGINT — Primary key — NOT NULL
- question_id — BIGINT — Foreign key → questions.question_id — NOT NULL
- wiki_section_id — BIGINT — Foreign key → wiki_sections.wiki_section_id — NOT NULL
- source_order — INT — NOT NULL
- relevance_score — DECIMAL(5,4)
questions
- question_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- question_text — TEXT — NOT NULL
- topic — VARCHAR(255)
- answer_text — LONGTEXT
- answer_status — VARCHAR(30) — NOT NULL
- failure_reason — VARCHAR(1000)
- asked_at — DATETIME — NOT NULL
- answered_at — DATETIME
roles
- role_id — BIGINT — Primary key — NOT NULL
- code — VARCHAR(50) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- description — VARCHAR(500)
schedule_departments
- schedule_department_id — BIGINT — Primary key — NOT NULL
- schedule_id — BIGINT — Foreign key → schedules.schedule_id — NOT NULL
- department_id — BIGINT — Foreign key → departments.department_id — NOT NULL
schedule_job_positions
- schedule_job_position_id — BIGINT — Primary key — NOT NULL
- schedule_id — BIGINT — Foreign key → schedules.schedule_id — NOT NULL
- job_position_id — BIGINT — Foreign key → job_positions.job_position_id — NOT NULL
schedules
- schedule_id — BIGINT — Primary key — NOT NULL
- source_document_version_id — BIGINT — Foreign key → document_versions.document_version_id
- ai_job_id — BIGINT — Foreign key → ai_jobs.ai_job_id
- created_by — BIGINT — Foreign key → users.user_id
- title — VARCHAR(255) — NOT NULL
- description — TEXT
- schedule_type — VARCHAR(30) — NOT NULL
- approval_status — VARCHAR(30) — NOT NULL
- start_at — DATETIME — NOT NULL
- end_at — DATETIME
- application_deadline — DATETIME
- target_joined_from — DATE
- target_joined_to — DATE
- reviewed_by — BIGINT — Foreign key → users.user_id
- reviewed_at — DATETIME
- rejection_reason — VARCHAR(1000)
- published_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
tags
- tag_id — BIGINT — Primary key — NOT NULL
- name — VARCHAR(100) — NOT NULL
- created_at — DATETIME — NOT NULL
user_roles
- user_role_id — BIGINT — Primary key — NOT NULL
- user_id — BIGINT — Foreign key → users.user_id — NOT NULL
- role_id — BIGINT — Foreign key → roles.role_id — NOT NULL
- granted_at — DATETIME — NOT NULL
users
- user_id — BIGINT — Primary key — NOT NULL
- department_id — BIGINT — Foreign key → departments.department_id
- job_position_id — BIGINT — Foreign key → job_positions.job_position_id
- email — VARCHAR(255) — NOT NULL
- password_hash — VARCHAR(255) — NOT NULL
- name — VARCHAR(100) — NOT NULL
- employee_number — VARCHAR(50)
- status — VARCHAR(30) — NOT NULL
- joined_at — DATE
- last_login_at — DATETIME
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
wiki_department_permissions
- wiki_department_permission_id — BIGINT — Primary key — NOT NULL
- wiki_id — BIGINT — Foreign key → wikis.wiki_id — NOT NULL
- department_id — BIGINT — Foreign key → departments.department_id — NOT NULL
- created_at — DATETIME — NOT NULL
wiki_role_permissions
- wiki_role_permission_id — BIGINT — Primary key — NOT NULL
- wiki_id — BIGINT — Foreign key → wikis.wiki_id — NOT NULL
- role_id — BIGINT — Foreign key → roles.role_id — NOT NULL
- created_at — DATETIME — NOT NULL
wiki_section_sources
- wiki_section_source_id — BIGINT — Primary key — NOT NULL
- wiki_section_id — BIGINT — Foreign key → wiki_sections.wiki_section_id — NOT NULL
- document_chunk_id — BIGINT — Foreign key → document_chunks.document_chunk_id — NOT NULL
- source_quote — TEXT
- relevance_score — DECIMAL(5,4)
- created_at — DATETIME — NOT NULL
wiki_sections
- wiki_section_id — BIGINT — Primary key — NOT NULL
- wiki_version_id — BIGINT — Foreign key → wiki_versions.wiki_version_id — NOT NULL
- section_order — INT — NOT NULL
- heading — VARCHAR(255)
- content — TEXT — NOT NULL
- source_validation_status — VARCHAR(30) — NOT NULL
wiki_versions
- wiki_version_id — BIGINT — Primary key — NOT NULL
- wiki_id — BIGINT — Foreign key → wikis.wiki_id — NOT NULL
- ai_job_id — BIGINT — Foreign key → ai_jobs.ai_job_id
- version_number — INT — NOT NULL
- version_type — VARCHAR(30) — NOT NULL
- title — VARCHAR(255) — NOT NULL
- summary — TEXT
- approval_status — VARCHAR(30) — NOT NULL
- change_instruction — TEXT
- generated_at — DATETIME — NOT NULL
- reviewed_by — BIGINT — Foreign key → users.user_id
- reviewed_at — DATETIME
- rejection_reason — VARCHAR(1000)
- published_at — DATETIME
wikis
- wiki_id — BIGINT — Primary key — NOT NULL
- title — VARCHAR(255) — NOT NULL
- current_version_number — INT
- visibility_status — VARCHAR(30) — NOT NULL
- created_at — DATETIME — NOT NULL
- updated_at — DATETIME — NOT NULL
- deleted_at — DATETIME
- restorable_until — DATETIME