moa

Tables (16)

ai_generation_job

  • id — BIGSERIAL
  • journal_id — BIGINT — Foreign key → observation_journal.id
  • requested_by — BIGINT — Foreign key → users.id
  • job_scope — VARCHAR(20)
  • target_section_type — VARCHAR(50)
  • input_payload — JSONB
  • output_payload — JSONB
  • status — VARCHAR(20)
  • token_usage — INT
  • error_message — TEXT
  • started_at — TIMESTAMP
  • finished_at — TIMESTAMP
  • created_at — TIMESTAMP

auth_provider

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • provider — VARCHAR(30)
  • provider_user_id — VARCHAR(150)
  • provider_email — VARCHAR(150)
  • linked_at — TIMESTAMP
  • created_at — TIMESTAMP

community_post

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • board_type — VARCHAR(20)
  • title — VARCHAR(255)
  • content — TEXT
  • like_count — INT
  • comment_count — INT
  • bookmark_count — INT
  • share_count — INT
  • view_count — INT
  • is_deleted — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

credit_transaction

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • transaction_type — VARCHAR(20)
  • source_type — VARCHAR(30)
  • source_id — BIGINT
  • amount — INT
  • balance_after — INT
  • memo — VARCHAR(255)
  • created_at — TIMESTAMP

credit_wallet

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • current_credit — INT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

notification

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • type — VARCHAR(30)
  • title — VARCHAR(255)
  • message — VARCHAR(500)
  • target_type — VARCHAR(30)
  • target_id — BIGINT
  • is_read — BOOLEAN
  • created_at — TIMESTAMP

observation_journal

  • id — BIGSERIAL
  • organization_id — BIGINT — Foreign key → organization.id
  • user_id — BIGINT — Foreign key → users.id
  • child_name — VARCHAR(100)
  • child_age — VARCHAR(50)
  • behavior_note — TEXT
  • curriculum_area — VARCHAR(50)
  • area_decision_type — VARCHAR(20)
  • phone_consult_required — BOOLEAN
  • status — VARCHAR(20)
  • is_saved — BOOLEAN
  • saved_at — TIMESTAMP
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

observation_section

  • id — BIGSERIAL
  • journal_id — BIGINT — Foreign key → observation_journal.id
  • section_type — VARCHAR(50)
  • content — TEXT
  • version — INT
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

organization

  • id — BIGSERIAL
  • name — VARCHAR(100)
  • code — VARCHAR(50)
  • domain — VARCHAR(100)
  • status — VARCHAR(20)
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

post_attachment

  • id — BIGSERIAL
  • post_id — BIGINT — Foreign key → community_post.id
  • original_name — VARCHAR(255)
  • storage_key — VARCHAR(255)
  • file_size — BIGINT
  • content_type — VARCHAR(100)
  • created_at — TIMESTAMP

post_bookmark

  • id — BIGSERIAL
  • post_id — BIGINT — Foreign key → community_post.id
  • user_id — BIGINT — Foreign key → users.id
  • created_at — TIMESTAMP

post_comment

  • id — BIGSERIAL
  • post_id — BIGINT — Foreign key → community_post.id
  • user_id — BIGINT — Foreign key → users.id
  • parent_comment_id — BIGINT — Foreign key → post_comment.id
  • content — TEXT
  • is_deleted — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

post_like

  • id — BIGSERIAL
  • post_id — BIGINT — Foreign key → community_post.id
  • user_id — BIGINT — Foreign key → users.id
  • created_at — TIMESTAMP

post_share

  • id — BIGSERIAL
  • post_id — BIGINT — Foreign key → community_post.id
  • user_id — BIGINT — Foreign key → users.id
  • share_type — VARCHAR(30)
  • created_at — TIMESTAMP

user_profile

  • id — BIGSERIAL
  • user_id — BIGINT — Foreign key → users.id
  • organization_type — VARCHAR(50)
  • assigned_age_group — VARCHAR(50)
  • phone_consult_default — BOOLEAN
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP

users

  • id — BIGSERIAL
  • organization_id — BIGINT — Foreign key → organization.id
  • email — VARCHAR(150)
  • name — VARCHAR(100)
  • role — VARCHAR(20)
  • status — VARCHAR(20)
  • last_login_at — TIMESTAMP
  • created_at — TIMESTAMP
  • updated_at — TIMESTAMP