test

Tables (46)

ai_jobs

  • ai_job_id — bigint — Primary key — NOT NULL
  • job_type — character varying(30) — NOT NULL
  • source_media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • result_media_file_id — uuid — Foreign key → media_files.media_file_id
  • status — character varying(20) — NOT NULL
  • error_code — character varying(50)
  • error_message — character varying(500)
  • requested_at — timestamp(6) with time zone — NOT NULL
  • started_at — timestamp(6) with time zone
  • completed_at — timestamp(6) with time zone

block_warning_dismissals

  • blocker_user_id — bigint — Foreign key → user_blocks.blocker_user_id — NOT NULL
  • blocked_user_id — bigint — Foreign key → user_blocks.blocked_user_id — NOT NULL
  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL

canvas_elements

  • element_id — uuid — Primary key — NOT NULL
  • page_id — uuid — Foreign key → pages.page_id — NOT NULL
  • element_type — character varying(20) — NOT NULL
  • group_id — uuid
  • name — character varying(100)
  • sort_key — numeric(20,10) — NOT NULL
  • x — numeric(12,3) — NOT NULL
  • y — numeric(12,3) — NOT NULL
  • width — numeric(12,3) — NOT NULL
  • height — numeric(12,3) — NOT NULL
  • rotation — numeric(7,3) — NOT NULL
  • opacity — numeric(4,3) — NOT NULL
  • is_locked — boolean — NOT NULL
  • is_hidden — boolean — NOT NULL
  • media_file_id — uuid — Foreign key → media_files.media_file_id
  • properties_json — jsonb
  • created_by — bigint — Foreign key → users.user_id
  • version — bigint — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL
  • deleted_at — timestamp(6) with time zone

canvas_history_operations

  • operation_id — bigint — Primary key — NOT NULL
  • page_id — uuid — Foreign key → pages.page_id — NOT NULL
  • actor_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • client_operation_id — uuid — NOT NULL
  • operation_type — character varying(20) — NOT NULL
  • snapshot_format — character varying(30) — NOT NULL
  • before_state_json — jsonb — NOT NULL
  • after_state_json — jsonb — NOT NULL
  • status — character varying(20) — NOT NULL
  • undone_at — timestamp(6) with time zone
  • created_at — timestamp(6) with time zone — NOT NULL

diaries

  • diary_id — uuid — Primary key — NOT NULL
  • owner_user_id — bigint — Foreign key → users.user_id
  • owner_device_id — character varying(64)
  • title — character varying(100) — NOT NULL
  • cover_color — character(7) — NOT NULL
  • cover_style — character varying(30) — NOT NULL
  • visibility — character varying(20) — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL
  • deleted_at — timestamp(6) with time zone
  • version — bigint — NOT NULL
  • cover_json — text
  • paper_appearance_json — text
  • template_config_json — text

diary_creation_receipts

  • key_hash — character(64) — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • request_hash — character(64) — NOT NULL
  • diary_id — uuid — Foreign key → diaries.diary_id
  • response_body — jsonb
  • created_at — timestamp(6) with time zone — NOT NULL
  • completed_at — timestamp(6) with time zone

diary_handwriting_fonts

  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL
  • font_media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • granted_by_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • is_enabled — boolean — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • disabled_at — timestamp(6) with time zone

diary_invites

  • invite_id — bigint — Primary key — NOT NULL
  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL
  • inviter_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • invitee_user_id — bigint — Foreign key → users.user_id
  • invite_type — character varying(20) — NOT NULL
  • token_hash — bytea — NOT NULL
  • role — character varying(20) — NOT NULL
  • max_uses — integer
  • use_count — integer — NOT NULL
  • expires_at — timestamp(6) with time zone — NOT NULL
  • revoked_at — timestamp(6) with time zone
  • created_at — timestamp(6) with time zone — NOT NULL
  • retention_until — timestamp(6) with time zone — NOT NULL

diary_media_library

  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL
  • media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • added_by_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • library_category — character varying(20) — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL

diary_members

  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • role — character varying(20) — NOT NULL
  • member_color — character(7) — NOT NULL
  • is_favorite — boolean — NOT NULL
  • last_opened_page_id — uuid — Foreign key → pages.page_id
  • last_opened_at — timestamp(6) with time zone
  • joined_at — timestamp(6) with time zone — NOT NULL
  • left_at — timestamp(6) with time zone
  • member_nickname — character varying(30)
  • member_profile_photo_id — uuid — Foreign key → media_files.media_file_id

diary_purge_receipts

  • diary_id — uuid — Primary key — NOT NULL
  • owner_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • completed_at — timestamp with time zone — NOT NULL

element_strokes

  • element_id — uuid — Foreign key → canvas_elements.element_id — NOT NULL
  • tool — character varying(20) — NOT NULL
  • pen_kind — character varying(20)
  • color — character(7) — NOT NULL
  • stroke_width — numeric(8,3) — NOT NULL
  • line_cap — character varying(10) — NOT NULL
  • base_width — numeric(12,3) — NOT NULL
  • base_height — numeric(12,3) — NOT NULL
  • point_format — character varying(30) — NOT NULL
  • points — jsonb — NOT NULL

invitation_notification_receipts

  • event_id — uuid — Primary key — NOT NULL
  • recipient_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • invite_id — bigint — NOT NULL
  • event_occurred_at — timestamp(6) with time zone — NOT NULL
  • outcome — character varying(30) — NOT NULL
  • notification_id — bigint — Foreign key → notifications.notification_id
  • processed_at — timestamp(6) with time zone — NOT NULL

media_files

  • media_file_id — uuid — Primary key — NOT NULL
  • owner_user_id — bigint — Foreign key → users.user_id
  • owner_device_id — character varying(64)
  • media_type — character varying(20) — NOT NULL
  • source_type — character varying(20) — NOT NULL
  • source_media_file_id — uuid — Foreign key → media_files.media_file_id
  • library_category — character varying(20) — NOT NULL
  • storage_key — character varying(500) — NOT NULL
  • original_filename — character varying(255)
  • mime_type — character varying(100) — NOT NULL
  • file_size — bigint — NOT NULL
  • width — integer
  • height — integer
  • checksum_sha256 — character(64)
  • status — character varying(20) — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • deleted_at — timestamp(6) with time zone

media_storage_deletion_queue

  • deletion_id — uuid — Primary key — NOT NULL
  • media_file_id — uuid — NOT NULL
  • storage_key — character varying(500) — NOT NULL
  • queued_at — timestamp with time zone — NOT NULL
  • attempt_count — integer — NOT NULL
  • last_attempt_at — timestamp with time zone
  • last_error — character varying(1000)
  • next_attempt_at — timestamp with time zone — NOT NULL

notification_read_watermark_items

  • notification_id — bigint — Foreign key → notifications.notification_id — NOT NULL
  • watermark_id — uuid — Foreign key → notification_read_watermarks.watermark_id — NOT NULL

notification_read_watermarks

  • watermark_id — uuid — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • expires_at — timestamp(6) with time zone — NOT NULL
  • applied_at — timestamp(6) with time zone

notifications

  • notification_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • actor_user_id — bigint — Foreign key → users.user_id
  • diary_id — uuid — Foreign key → diaries.diary_id
  • page_id — uuid — Foreign key → pages.page_id
  • notification_type — character varying(50) — NOT NULL
  • payload_json — jsonb
  • read_at — timestamp(6) with time zone
  • deleted_at — timestamp(6) with time zone
  • created_at — timestamp(6) with time zone — NOT NULL

page_template_v27_backups

  • page_id — uuid — Primary key — NOT NULL
  • previous_template_id — bigint
  • previous_template_config — jsonb
  • previous_version — bigint — NOT NULL
  • previous_updated_at — timestamp(6) with time zone — NOT NULL
  • backed_up_at — timestamp(6) with time zone — NOT NULL

page_template_v35_links

  • page_id — uuid — Primary key — NOT NULL
  • linked_template_id — bigint — NOT NULL
  • previous_version — bigint — NOT NULL
  • previous_updated_at — timestamp(6) with time zone — NOT NULL
  • linked_at — timestamp(6) with time zone — NOT NULL

page_templates

  • template_id — bigint — Primary key — NOT NULL
  • code — character varying(100) — NOT NULL
  • template_version — character varying(30) — NOT NULL
  • name — character varying(100) — NOT NULL
  • category — character varying(30) — NOT NULL
  • orientation — character varying(20) — NOT NULL
  • canvas_width — numeric(10,2) — NOT NULL
  • canvas_height — numeric(10,2) — NOT NULL
  • default_config — jsonb
  • display_order — integer — NOT NULL
  • is_active — boolean — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

pages

  • page_id — uuid — Primary key — NOT NULL
  • diary_id — uuid — Foreign key → diaries.diary_id — NOT NULL
  • template_id — bigint — Foreign key → page_templates.template_id
  • template_config — jsonb
  • title — character varying(100)
  • sort_key — numeric(20,10) — NOT NULL
  • canvas_width — numeric(10,2) — NOT NULL
  • canvas_height — numeric(10,2) — NOT NULL
  • grid_visible — boolean — NOT NULL
  • grid_color — character(7)
  • version — bigint — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL
  • deleted_at — timestamp(6) with time zone

password_reset_verifications

  • email — character varying(255) — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • code_hash — character(64) — NOT NULL
  • sent_at — timestamp with time zone — NOT NULL
  • expires_at — timestamp with time zone — NOT NULL
  • failed_attempts — integer — NOT NULL
  • token_hash — character(64)
  • token_expires_at — timestamp with time zone
  • consumed_at — timestamp with time zone

push_deliveries

  • binding_version — bigint — Primary key — NOT NULL
  • installation_id — uuid — Foreign key → push_installations.installation_id — NOT NULL
  • outbox_id — uuid — Foreign key → push_outbox.outbox_id — NOT NULL
  • token_version — bigint — NOT NULL
  • status — character varying(24) — NOT NULL
  • attempt_count — integer — NOT NULL
  • next_attempt_at — timestamp(6) with time zone
  • lease_until — timestamp(6) with time zone
  • lease_id — uuid
  • provider_ticket_id — character varying(255)
  • result_code — character varying(128)
  • accepted_at — timestamp(6) with time zone
  • terminal_at — timestamp(6) with time zone

push_installations

  • installation_id — uuid — Primary key — NOT NULL
  • environment — character varying(32) — NOT NULL
  • app_id — character varying(160) — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • session_id — uuid — NOT NULL
  • credential_hash — bytea — NOT NULL
  • provider — character varying(16) — NOT NULL
  • platform — character varying(16) — NOT NULL
  • token_ciphertext — bytea
  • token_key_id — character varying(64)
  • token_cipher_format — smallint
  • token_hash — bytea
  • permission — character varying(16) — NOT NULL
  • enabled — boolean — NOT NULL
  • binding_version — bigint — NOT NULL
  • token_version — bigint — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL
  • disabled_at — timestamp(6) with time zone

push_mutation_requests

  • session_id — uuid — Primary key — NOT NULL
  • installation_id — uuid — Primary key — NOT NULL
  • request_id — uuid — Primary key — NOT NULL
  • request_hash — bytea — NOT NULL
  • operation — character varying(16) — NOT NULL
  • binding_version — bigint — NOT NULL
  • token_version — bigint — NOT NULL
  • result_provider — character varying(16) — NOT NULL
  • result_platform — character varying(16) — NOT NULL
  • result_permission — character varying(16) — NOT NULL
  • result_enabled — boolean — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL

push_outbox

  • outbox_id — uuid — Primary key — NOT NULL
  • event_key — character varying(255) — NOT NULL
  • notification_id — bigint — Foreign key → notifications.notification_id
  • recipient_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • event_type — character varying(64) — NOT NULL
  • reference_id — character varying(255)
  • status — character varying(24) — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL
  • expires_at — timestamp(6) with time zone — NOT NULL
  • environment — character varying(32)
  • app_id — character varying(160)
  • terminal_at — timestamp(6) with time zone

push_registration_requests

  • session_id — uuid — Primary key — NOT NULL
  • installation_id — uuid — Primary key — NOT NULL
  • request_id — uuid — Primary key — NOT NULL
  • request_hash — bytea — NOT NULL
  • encrypted_response — bytea
  • response_key_id — character varying(64)
  • response_cipher_format — smallint
  • expires_at — timestamp(6) with time zone — NOT NULL
  • created_at — timestamp(6) with time zone — NOT NULL

refresh_token_history

  • token_hash — character(64) — Primary key — NOT NULL
  • token_id — bigint — Foreign key → refresh_tokens.token_id — NOT NULL
  • rotated_at — timestamp with time zone — NOT NULL

refresh_tokens

  • token_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • token_hash — character(64) — NOT NULL
  • device_name — character varying(100)
  • expires_at — timestamp(6) with time zone — NOT NULL
  • revoked_at — timestamp(6) with time zone
  • created_at — timestamp(6) with time zone — NOT NULL
  • session_id — uuid — NOT NULL

signup_email_verifications

  • email — character varying(255) — Primary key — NOT NULL
  • code_hash — character(64) — NOT NULL
  • sent_at — timestamp with time zone — NOT NULL
  • expires_at — timestamp with time zone — NOT NULL
  • failed_attempts — integer — NOT NULL
  • token_hash — character(64)
  • token_expires_at — timestamp with time zone
  • consumed_at — timestamp with time zone

signup_profile_photos

  • photo_id — uuid — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • image_bytes — bytea
  • created_at — timestamp with time zone — NOT NULL
  • storage_provider — character varying(10)
  • storage_key — character varying(200)
  • storage_bucket — character varying(255)

user_auth_accounts

  • auth_account_id — bigint — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • provider — character varying(20) — NOT NULL
  • provider_subject — character varying(255) — NOT NULL
  • password_hash — character varying(255)
  • linked_at — timestamp(6) with time zone — NOT NULL

user_blocks

  • blocked_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • blocker_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • created_at — timestamp with time zone — NOT NULL

user_cover_libraries

  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • version — bigint — NOT NULL
  • document_json — text — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

user_cover_library_media

  • media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL

user_palettes

  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • version — bigint — NOT NULL
  • document_json — text — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

user_paper_libraries

  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • version — bigint — NOT NULL
  • document_json — text — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

user_paper_library_media

  • media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL

user_reports

  • report_id — bigint — Primary key — NOT NULL
  • reporter_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • reported_user_id — bigint — Foreign key → users.user_id — NOT NULL
  • diary_id — uuid — NOT NULL
  • client_request_id — uuid — NOT NULL
  • request_hash — character varying(64) — NOT NULL
  • reason_code — character varying(40) — NOT NULL
  • description — character varying(1000)
  • evidence_json — jsonb — NOT NULL
  • status — character varying(20) — NOT NULL
  • action_type — character varying(30)
  • action_expires_at — timestamp with time zone
  • resolution_note — text
  • handled_by — character varying(100)
  • created_at — timestamp with time zone — NOT NULL
  • updated_at — timestamp with time zone — NOT NULL
  • resolved_at — timestamp with time zone
  • notification_status — character varying(20) — NOT NULL
  • notification_attempts — integer — NOT NULL
  • notification_next_attempt_at — timestamp with time zone
  • history_json — jsonb — NOT NULL

user_sticker_libraries

  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • version — bigint — NOT NULL
  • document_json — text — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

user_sticker_library_media

  • media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL

user_tape_libraries

  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • version — bigint — NOT NULL
  • document_json — text — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL

user_tape_library_media

  • media_file_id — uuid — Foreign key → media_files.media_file_id — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL

user_terms_agreements

  • terms_type — character varying(20) — Primary key — NOT NULL
  • terms_version — character varying(20) — Primary key — NOT NULL
  • user_id — bigint — Foreign key → users.user_id — NOT NULL
  • agreed — boolean — NOT NULL
  • agreed_at — timestamp(6) with time zone — NOT NULL

users

  • user_id — bigint — Primary key — NOT NULL
  • email — character varying(255)
  • nickname — character varying(30) — NOT NULL
  • profile_img — character(7) — NOT NULL
  • status — character varying(20) — NOT NULL
  • last_login_at — timestamp(6) with time zone
  • created_at — timestamp(6) with time zone — NOT NULL
  • updated_at — timestamp(6) with time zone — NOT NULL
  • deleted_at — timestamp(6) with time zone
  • nickname_key — character varying(30) — NOT NULL
  • profile_color — character(7) — NOT NULL