factory

Tables (12)

ai_alerts

  • id — BIGINT — Primary key — NOT NULL
  • company_id — BIGINT — Foreign key → companies.id — NOT NULL
  • process_id — BIGINT — Foreign key → processes.id — NOT NULL
  • analysis_id — BIGINT — Foreign key → ai_analyses.id
  • severity — ENUM('info','warning','critical') — NOT NULL
  • title — VARCHAR(300) — NOT NULL
  • content — TEXT — NOT NULL
  • is_read — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • Key — Foreign key → ai_analyses.Key — NOT NULL
  • Key (Key2) — Foreign key → companies.Key — NOT NULL
  • Key2 (Key22) — Foreign key → processes.Key2 — NOT NULL
  • Key3 — Foreign key → processes.Key3 — NOT NULL
  • Key4 — Foreign key → ai_analyses.Key4 — NOT NULL
  • Key5 (Key52) — Foreign key → ai_analyses.Key5 — NOT NULL
  • Key6 — Foreign key — NOT NULL
  • Key4 (Key42) — Foreign key → processes.Key4 — NOT NULL
  • Key5 — Foreign key — NOT NULL
  • Key4 (Key43) — Foreign key → ai_analyses.Key4 — NOT NULL
  • Key6 (Key62) — Foreign key → ai_analyses.Key6 — NOT NULL
  • Key7 — Foreign key → ai_analyses.Key7 — NOT NULL

ai_analyses

  • id — BIGINT — Primary key — NOT NULL
  • Key5 — Primary key — NOT NULL
  • upload_id — BIGINT — Foreign key → monthly_data_uploads.id — NOT NULL
  • process_id — BIGINT — Foreign key → processes.id — NOT NULL
  • summary — TEXT — AI 분석 요약
  • improvements — TEXT — 개선 방안
  • risk_factors — TEXT — 위험 요인
  • score — FLOAT — 공정 점수(0~100)
  • status — ENUM('pending', 'done', 'failed') — NOT NULL
  • analyzed_at — DATETIME
  • Key — Foreign key → monthly_data_uploads.Key — NOT NULL
  • Key (Key2) — Foreign key → processes.Key — NOT NULL
  • Key2 (Key22) — Foreign key → processes.Key2 — NOT NULL
  • Key3 — Foreign key → processes.Key3 — NOT NULL
  • Key4 — Foreign key — NOT NULL
  • Key4 (Key42) — Foreign key → processes.Key4 — NOT NULL
  • Key5 (Key52) — Foreign key — NOT NULL
  • Key4 (Key43) — Foreign key → monthly_data_uploads.Key4 — NOT NULL
  • Key6 — Foreign key → monthly_data_uploads.Key6 — NOT NULL
  • Key7 — Foreign key — NOT NULL

boards

  • id — BIGINT — Primary key — NOT NULL
  • Key2 — Primary key — NOT NULL
  • Key3 — Primary key — NOT NULL
  • Key4 — Primary key — NOT NULL
  • company_id — BIGINT — Foreign key → companies.id — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • type — ENUM('general','notice','ai_alert') — NOT NULL
  • is_active — TINYINT(1) — NOT NULL
  • Key — Foreign key → companies.Key — NOT NULL

comments

  • id — BIGINT — Primary key — NOT NULL
  • post_id — BIGINT — Foreign key → posts.id — NOT NULL
  • author_id — BIGINT — Foreign key → users.id — NOT NULL
  • parent_id — BIGINT — Foreign key → comments.id
  • content — TEXT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • deleted_at — DATETIME
  • Key — Foreign key → users.Key — NOT NULL
  • Key (Key2) — Foreign key → posts.Key — NOT NULL
  • Key2 (Key22) — Foreign key → posts.Key2 — NOT NULL
  • Key3 — Foreign key → posts.Key3 — NOT NULL
  • Key4 — Foreign key → posts.Key4 — NOT NULL
  • Key5 — Foreign key → posts.Key5 — NOT NULL
  • Field

companies

  • id — BIGINT — Primary key — NOT NULL
  • Key — Primary key — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • industry — VARCHAR(100)
  • address — VARCHAR(300)
  • created_at — DATETIME — NOT NULL

monthly_data_uploads

  • id — BIGINT — Primary key — NOT NULL
  • Key4 — Primary key — NOT NULL
  • Key6 — Primary key — NOT NULL
  • company_id — BIGINT — Foreign key → companies.id — NOT NULL
  • process_id — BIGINT — Foreign key → processes.id — NOT NULL
  • uploaded_by — BIGINT — Foreign key → users.id — NOT NULL
  • year — SMALLINT — NOT NULL
  • month — TINYINT — NOT NULL
  • file_url — VARCHAR(500) — NOT NULL
  • status — ENUM('pending','processing','done','failed') — NOT NULL
  • uploaded_at — DATETIME — NOT NULL
  • processed_at — DATETIME
  • Key — Foreign key → users.Key — NOT NULL
  • Key (Key2) — Foreign key → companies.Key — NOT NULL
  • Key2 (Key22) — Foreign key → processes.Key2 — NOT NULL
  • Key3 — Foreign key → processes.Key3 — NOT NULL
  • Key4 (Key42) — Foreign key → processes.Key4 — NOT NULL
  • Key5 — Foreign key — NOT NULL

notifications

  • id — BIGINT — Primary key — NOT NULL
  • Key2 — Primary key — NOT NULL
  • Key3 — Primary key — NOT NULL
  • Key4 — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • type — ENUM('post', 'comment', 'ai_alert', 'system') — NOT NULL
  • title — VARCHAR(300) — NOT NULL
  • content — TEXT
  • ref_id — BIGINT — 참조 대상 ID
  • ref_type — VARCHAR(50) — 참조 대상 테이블명
  • is_read — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • Key — Foreign key → users.Key — NOT NULL

posts

  • id — BIGINT — Primary key — NOT NULL
  • board_id — BIGINT — Foreign key → boards.id — NOT NULL
  • author_id — BIGINT — Foreign key → users.id — NOT NULL
  • title — VARCHAR(300) — NOT NULL
  • content — TEXT — NOT NULL
  • post_type — ENUM('general','notice','ai_alert') — NOT NULL
  • view_count — INT — NOT NULL
  • is_pinned — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • deleted_at — DATETIME
  • Field
  • Key — Foreign key → users.Key — NOT NULL
  • Key (Key2) — Foreign key → boards.Key — NOT NULL
  • Key2 (Key22) — Foreign key → boards.Key2 — NOT NULL
  • Key3 — Foreign key → boards.Key3 — NOT NULL
  • Key4 — Foreign key → boards.Key4 — NOT NULL
  • Key5 — Foreign key — NOT NULL

process_status

  • id — BIGINT — Primary key — NOT NULL
  • Key3 — Primary key — NOT NULL
  • process_id — BIGINT — Foreign key → processes.id — NOT NULL
  • production_rate — FLOAT — 생산율(%)
  • defect_rate — FLOAT — 불량률(%)
  • efficiency — FLOAT — 효율(%)
  • temperature — FLOAT — 온도(°C)
  • pressure — FLOAT — 압력(kPa)
  • measured_at — DATETIME — NOT NULL
  • Field
  • Key — Foreign key → processes.Key — NOT NULL
  • Key2 — Foreign key → processes.Key2 — NOT NULL
  • Key3 (Key32) — Foreign key → processes.Key3 — NOT NULL
  • Key4 — Foreign key → processes.Key4 — NOT NULL
  • Key5 — Foreign key — NOT NULL

processes

  • id — BIGINT — Primary key — NOT NULL
  • Key2 — Primary key — NOT NULL
  • Key3 — Primary key — NOT NULL
  • Key4 — Primary key — NOT NULL
  • company_id — BIGINT — Foreign key → companies.id — NOT NULL
  • name — VARCHAR(200) — NOT NULL
  • description — TEXT
  • status — ENUM('active','inactive','maintenance') — NOT NULL
  • created_at — DATETIME — NOT NULL
  • Key — Foreign key → companies.Key — NOT NULL

user_company

  • id — BIGINT — Primary key — NOT NULL
  • Key2 — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.id — NOT NULL
  • company_id — BIGINT — Foreign key → companies.id — NOT NULL
  • department — VARCHAR(100)
  • position — VARCHAR(100)
  • joined_at — DATE
  • Field
  • Field2
  • Key — Foreign key → users.Key — NOT NULL
  • Key (Key4) — Foreign key → companies.Key — NOT NULL

users

  • id — BIGINT — Primary key — NOT NULL
  • Key — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password_hash — VARCHAR(255) — NOT NULL
  • name — VARCHAR(100) — NOT NULL
  • phone — VARCHAR(20)
  • role — ENUM('admin','manager','user') — NOT NULL
  • is_active — TINYINT(1) — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL
  • Field