PTManager

Tables (11)

app_user

  • id — BIGINT — Primary key — NOT NULL
  • email — VARCHAR(255) — NOT NULL
  • password — VARCHAR(255) — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • role — VARCHAR(16) — NOT NULL
  • workplace_id — BIGINT — Foreign key → workplace.id
  • hourly_wage — INTEGER — NOT NULL
  • last_read_notice_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

device_token

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • token — VARCHAR(512) — NOT NULL
  • platform — VARCHAR(16) — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

join_request

  • id — BIGINT — Primary key — NOT NULL
  • workplace_id — BIGINT — Foreign key → workplace.id — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • status — VARCHAR(16) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

notice

  • id — BIGINT — Primary key — NOT NULL
  • workplace_id — BIGINT — Foreign key → workplace.id — NOT NULL
  • author_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • title — VARCHAR(255) — NOT NULL
  • body — TEXT — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

notice_attachment

  • id — BIGINT — Primary key — NOT NULL
  • notice_id — BIGINT — Foreign key → notice.id — NOT NULL
  • file_url — VARCHAR(512) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

notification

  • id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • type — VARCHAR(24) — NOT NULL
  • message — VARCHAR(255) — NOT NULL
  • target_type — VARCHAR(24)
  • target_id — BIGINT
  • is_read — BOOLEAN — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

notification_setting

  • user_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • swap_enabled — BOOLEAN — NOT NULL
  • notice_enabled — BOOLEAN — NOT NULL
  • attendance_enabled — BOOLEAN — NOT NULL
  • join_request_enabled — BOOLEAN — NOT NULL

shift

  • id — BIGINT — Primary key — NOT NULL
  • workplace_id — BIGINT — Foreign key → workplace.id — NOT NULL
  • employee_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • work_date — DATE — NOT NULL
  • start_time — TIME — NOT NULL
  • end_time — TIME — NOT NULL
  • checked_in_at — TIMESTAMPTZ
  • attendance_status — VARCHAR(16) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

swap_application

  • id — BIGINT — Primary key — NOT NULL
  • swap_request_id — BIGINT — Foreign key → swap_request.id — NOT NULL
  • applicant_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • status — VARCHAR(16) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

swap_request

  • id — BIGINT — Primary key — NOT NULL
  • workplace_id — BIGINT — Foreign key → workplace.id — NOT NULL
  • shift_id — BIGINT — Foreign key → shift.id — NOT NULL
  • requester_id — BIGINT — Foreign key → app_user.id — NOT NULL
  • substitute_id — BIGINT — Foreign key → app_user.id
  • reason — VARCHAR(500) — NOT NULL
  • status — VARCHAR(16) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

workplace

  • id — BIGINT — Primary key — NOT NULL
  • name — VARCHAR(255) — NOT NULL
  • address — VARCHAR(255)
  • invite_code — VARCHAR(16) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL