d

Tables (11)

approval_history

  • id — BIGINT — Primary key — NOT NULL
  • request_id — BIGINT — Foreign key → approval_request.id — NOT NULL
  • actor_id — BIGINT — Foreign key → user.id — NOT NULL
  • action — ENUM( 'SUBMIT', 'APPROVE', 'REJECT', 'RESUBMIT', 'UPDATE' ) — NOT NULL
  • from_status — ENUM('DRAFT', 'PENDING', 'APPROVED', 'REJECTED')
  • to_status — ENUM('DRAFT', 'PENDING', 'APPROVED', 'REJECTED')
  • memo — TEXT
  • created_at — DATETIME — NOT NULL

approval_history_detail

  • id — BIGINT — Primary key — NOT NULL
  • history_id — BIGINT — Foreign key → approval_history.id — NOT NULL
  • field_name — VARCHAR(100) — NOT NULL
  • old_value — TEXT
  • new_value — TEXT

approval_image

  • id — BIGINT — Primary key — NOT NULL
  • request_id — BIGINT — Foreign key → approval_request.id — NOT NULL
  • s3_key — VARCHAR(500) — NOT NULL
  • order_index — INT — NOT NULL
  • created_at — DATETIME — NOT NULL

approval_request

  • id — BIGINT — Primary key — NOT NULL
  • brand_id — BIGINT — Foreign key → brand.id — NOT NULL
  • submitter_id — BIGINT — Foreign key → user.id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • content — LONGTEXT — NOT NULL
  • status — ENUM( 'DRAFT', 'PENDING', 'APPROVED', 'REJECTED' ) — NOT NULL
  • version — INT — NOT NULL
  • created_at — DATETIME — NOT NULL
  • updated_at — DATETIME — NOT NULL

attachment

  • id — BIGINT — Primary key — NOT NULL
  • owner_type — ENUM('COMMENT') — NOT NULL
  • owner_id — BIGINT — NOT NULL
  • s3_key — VARCHAR(500) — NOT NULL
  • file_name — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL

brand

  • id — BIGINT — Primary key — NOT NULL
  • org_id — BIGINT — Foreign key → organization.id — NOT NULL
  • name — VARCHAR(255) — NOT NULL

comment

  • id — BIGINT — Primary key — NOT NULL
  • request_id — BIGINT — Foreign key → approval_request.id — NOT NULL
  • author_id — BIGINT — Foreign key → user.id — NOT NULL
  • content — TEXT — NOT NULL
  • parent_id — BIGINT — Foreign key → comment.id
  • deleted_at — DATETIME
  • deleted_by — BIGINT — Foreign key → user.id
  • created_at — DATETIME — NOT NULL

organization

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • type — ENUM('INTERNAL', 'BRAND') — NOT NULL
  • created_at — DATETIME — NOT NULL

role

  • id — BIGINT — Primary key — NOT NULL
  • role_name — VARCHAR(50) — NOT NULL

user

  • id — BIGINT — Primary key — NOT NULL
  • org_id — BIGINT — Foreign key → organization.id — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • created_at — DATETIME — NOT NULL

user_role_mapping

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → user.id — NOT NULL
  • brand_id — BIGINT — Foreign key → brand.id — NOT NULL
  • role_id — BIGINT — Foreign key → role.id — NOT NULL
  • UNIQUE(user_id, — brand_id,