motionerd

Tables (49)

admin_credentials

  • admin_credential_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • username — VARCHAR(50) — NOT NULL
  • password_hash — VARCHAR(100) — NOT NULL
  • must_change_password — BOOLEAN — NOT NULL
  • password_changed_at — TIMESTAMPTZ
  • failed_attempts — SMALLINT — NOT NULL
  • locked_until — TIMESTAMPTZ
  • last_login_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

admin_pack_grant_batches

  • batch_id — BIGINT — Primary key — NOT NULL
  • admin_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • scope — VARCHAR(10) — NOT NULL
  • kind — VARCHAR(10) — NOT NULL
  • packs_per_user — SMALLINT — NOT NULL
  • reason_memo — VARCHAR(200) — NOT NULL
  • target_count — INTEGER — NOT NULL
  • granted_count — INTEGER — NOT NULL
  • idempotency_key — UUID — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

admin_pack_grant_targets

  • batch_id — BIGINT — Foreign key → admin_pack_grant_batches.batch_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL

admin_totp

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • secret — VARCHAR(64) — NOT NULL
  • confirmed_at — TIMESTAMPTZ
  • last_used_counter — BIGINT
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

admin_totp_backup_codes

  • backup_code_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • code_hash — VARCHAR(100) — NOT NULL
  • used_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL

ai_generation_attempts

  • attempt_id — UUID — Primary key — NOT NULL
  • item_id — BIGINT — Foreign key → ai_generation_items.item_id — NOT NULL
  • command_key — UUID — NOT NULL
  • stage — VARCHAR(20) — NOT NULL
  • attempt_no — INTEGER — NOT NULL
  • trigger_type — VARCHAR(20) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • started_at — TIMESTAMPTZ
  • completed_at — TIMESTAMPTZ
  • legacy_excess_attempt — BOOLEAN — NOT NULL

ai_generation_batches

  • batch_id — BIGINT — Primary key — NOT NULL
  • generation_type — VARCHAR(30) — NOT NULL
  • requester_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • source_upload_id — BIGINT — Foreign key → uploads.upload_id — NOT NULL
  • gender_snapshot — VARCHAR(20) — NOT NULL
  • user_prompt — VARCHAR(500)
  • status — VARCHAR(30) — NOT NULL
  • total_count — INTEGER — NOT NULL
  • completed_count — INTEGER — NOT NULL
  • failed_count — INTEGER — NOT NULL
  • idempotency_key — UUID
  • created_at — TIMESTAMPTZ — NOT NULL
  • completed_at — TIMESTAMPTZ
  • canceled_at — TIMESTAMPTZ
  • request_hash — CHAR(64)
  • pipeline_version — VARCHAR(50)
  • generation_config — TEXT
  • draw_ready_at — TIMESTAMPTZ
  • birth_date_snapshot — DATE
  • execution_deadline_at — TIMESTAMPTZ
  • consent_snapshot — TEXT
  • request_mode — VARCHAR(30)

ai_generation_items

  • item_id — BIGINT — Primary key — NOT NULL
  • batch_id — BIGINT — Foreign key → ai_generation_batches.batch_id — NOT NULL
  • rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code
  • sequence_no — INTEGER — NOT NULL
  • style_preset — VARCHAR(50) — NOT NULL
  • card_asset_id — BIGINT — Foreign key → card_asset_versions.card_asset_id
  • asset_version_id — BIGINT — Foreign key → card_asset_versions.asset_version_id
  • status — VARCHAR(30) — NOT NULL
  • progress — INTEGER — NOT NULL
  • processing_owner — VARCHAR(100)
  • processing_lease_until — TIMESTAMPTZ
  • attempt_count — INTEGER — NOT NULL
  • callback_attempt_count — INTEGER — NOT NULL
  • error_code — VARCHAR(80)
  • model_version — VARCHAR(80) — NOT NULL
  • prompt_template_version — VARCHAR(80) — NOT NULL
  • seed — BIGINT
  • output_image_object_key — VARCHAR(1024)
  • output_thumbnail_object_key — VARCHAR(1024)
  • created_at — TIMESTAMPTZ — NOT NULL
  • started_at — TIMESTAMPTZ
  • completed_at — TIMESTAMPTZ
  • output_subject_mask_object_key — VARCHAR(1024)
  • concept — VARCHAR(100)
  • output_cutout_object_key — VARCHAR(1024)
  • preset_catalog_version — VARCHAR(80)
  • preset_collection_code — VARCHAR(50)
  • execution_target — VARCHAR(30)
  • generation_source — VARCHAR(20)
  • signature_applied — BOOLEAN — NOT NULL
  • reconcile_deadline_at — TIMESTAMPTZ
  • resume_dispatched_at — TIMESTAMPTZ
  • signature_required — BOOLEAN — NOT NULL
  • signature_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • signature_version — BIGINT
  • active_message_id — UUID

card_asset_versions

  • asset_version_id — BIGINT — Primary key — NOT NULL
  • card_asset_id — BIGINT — Foreign key → card_assets.card_asset_id — NOT NULL
  • version_no — INTEGER — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • source_media_file_id — BIGINT — Foreign key → media_files.media_file_id — NOT NULL
  • image_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • thumbnail_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • subject_mask_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • created_at — TIMESTAMPTZ — NOT NULL
  • activated_at — TIMESTAMPTZ
  • retired_at — TIMESTAMPTZ
  • cutout_media_file_id — BIGINT — Foreign key → media_files.media_file_id

card_assets

  • card_asset_id — BIGINT — Foreign key → card_asset_versions.card_asset_id — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • source_upload_id — BIGINT — Foreign key → uploads.upload_id — NOT NULL
  • original_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • image_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • thumbnail_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • subject_mask_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • display_name — VARCHAR(100) — NOT NULL
  • rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_by — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • active_version_id — BIGINT — Foreign key → card_asset_versions.asset_version_id
  • inactive_reason — VARCHAR(30)
  • cutout_media_file_id — BIGINT — Foreign key → media_files.media_file_id
  • n_art_category — VARCHAR(20)
  • base_photo_source_media_id — BIGINT — Foreign key → media_files.media_file_id

card_decorations

  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • version — BIGINT — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

card_fusion_candidates

  • fusion_id — BIGINT — Foreign key → card_fusions.fusion_id — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • probability — NUMERIC(30,25) — NOT NULL
  • probability_numerator — INTEGER — NOT NULL
  • probability_denominator — INTEGER — NOT NULL
  • asset_snapshot — VARCHAR(64) — NOT NULL

card_fusion_materials

  • material_order — SMALLINT — Primary key — NOT NULL
  • fusion_id — BIGINT — Foreign key → card_fusions.fusion_id — NOT NULL
  • material_card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL

card_fusions

  • fusion_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • quote_id — VARCHAR(36) — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id
  • source_rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • target_rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • material_count — INTEGER — NOT NULL
  • result_card_id — BIGINT — Foreign key → user_cards.card_id
  • idempotency_key — VARCHAR(36) — NOT NULL
  • response_snapshot — TEXT — NOT NULL
  • fused_at — TIMESTAMPTZ — NOT NULL
  • candidate_pool_hash — VARCHAR(64)
  • candidate_count — INTEGER
  • result_probability — NUMERIC(30,25)
  • recipe_version — VARCHAR(100)
  • succeeded — BOOLEAN — NOT NULL
  • success_percent — INTEGER

card_locks

  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • lock_type — VARCHAR(30) — NOT NULL
  • reference_type — VARCHAR(30) — NOT NULL
  • reference_id — VARCHAR(100) — NOT NULL
  • expires_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL

card_rarities

  • rarity_code — VARCHAR(20) — Primary key — NOT NULL
  • display_name — VARCHAR(40) — NOT NULL
  • sort_order — INTEGER — NOT NULL
  • active — BOOLEAN — NOT NULL
  • next_rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code
  • fusion_material_count — INTEGER
  • fusion_success_percent — INTEGER — NOT NULL

collection_slots

  • rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • representative_card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • duplicate_count — INTEGER — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

consent_records

  • consent_id — BIGINT — Primary key — NOT NULL
  • consent_submission_id — UUID — Foreign key → consent_submissions.consent_submission_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • consent_type — VARCHAR(40) — NOT NULL
  • granted — BOOLEAN — NOT NULL
  • policy_version — VARCHAR(100) — NOT NULL
  • text_hash — CHAR(64) — NOT NULL
  • occurred_at — TIMESTAMPTZ — NOT NULL
  • withdrawn_at — TIMESTAMPTZ

consent_submissions

  • consent_submission_id — UUID — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • idempotency_key — UUID — NOT NULL
  • payload_hash — CHAR(64) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

custom_pack_members

  • custom_pack_id — BIGINT — Foreign key → custom_packs.custom_pack_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL

custom_packs

  • custom_pack_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • slot_no — SMALLINT
  • name — VARCHAR(40) — NOT NULL
  • cover_preset_id — VARCHAR(30) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • deleted_at — TIMESTAMPTZ

decoration_elements

  • element_id — BIGINT — Primary key — NOT NULL
  • card_id — BIGINT — Foreign key → card_decorations.card_id — NOT NULL
  • author_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • type — VARCHAR(20) — NOT NULL
  • color — VARCHAR(20) — NOT NULL
  • x_ratio — DOUBLE PRECISION — NOT NULL
  • y_ratio — DOUBLE PRECISION — NOT NULL
  • rotation — DOUBLE PRECISION — NOT NULL
  • scale — DOUBLE PRECISION — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

draw_items

  • draw_item_id — BIGINT — Primary key — NOT NULL
  • draw_id — BIGINT — Foreign key → draws.draw_id — NOT NULL
  • slot_no — SMALLINT — NOT NULL
  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • card_asset_id — BIGINT — Foreign key → card_assets.card_asset_id — NOT NULL
  • rarity_snapshot — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • duplicate_at_draw — BOOLEAN — NOT NULL
  • gender_snapshot — VARCHAR(20)
  • concept_snapshot — VARCHAR(100)
  • draw_slot_no — SMALLINT
  • reveal_order_snapshot — SMALLINT
  • reveal_order — SMALLINT
  • n_art_category_snapshot — VARCHAR(20)

draw_policies

  • policy_version — BIGINT — Primary key — NOT NULL
  • draw_type — VARCHAR(30) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • effective_from — TIMESTAMPTZ — NOT NULL
  • effective_to — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • coin_cost — INTEGER

draw_policy_slot_entries

  • slot_no — SMALLINT — Primary key — NOT NULL
  • rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code — NOT NULL
  • policy_version — BIGINT — Foreign key → draw_policies.policy_version — NOT NULL
  • weight — INTEGER — NOT NULL

draws

  • draw_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • draw_type — VARCHAR(30) — NOT NULL
  • policy_version — BIGINT — Foreign key → draw_policies.policy_version — NOT NULL
  • card_count — SMALLINT — NOT NULL
  • used_free_draw — BOOLEAN — NOT NULL
  • consumed_coin — INTEGER — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • drawn_at — TIMESTAMPTZ — NOT NULL
  • remaining_free_draws_after — INTEGER
  • coin_balance_after — INTEGER
  • custom_pack_id — BIGINT — Foreign key → custom_packs.custom_pack_id
  • custom_pack_name_snapshot — VARCHAR(40)
  • custom_pack_cover_snapshot — VARCHAR(30)
  • n_art_policy_version — VARCHAR(40)

friend_activities

  • activity_id — BIGINT — Primary key — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • type — VARCHAR(30) — NOT NULL
  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • occurred_at — TIMESTAMPTZ — NOT NULL

friend_requests

  • request_id — BIGINT — Primary key — NOT NULL
  • sender_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • receiver_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • pending_pair_low_id — BIGINT
  • pending_pair_high_id — BIGINT
  • created_at — TIMESTAMPTZ — NOT NULL
  • responded_at — TIMESTAMPTZ

friendship_reward_pairs

  • low_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • high_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • recorded_at — TIMESTAMPTZ — NOT NULL
  • rewarded — BOOLEAN — NOT NULL

friendships

  • friendship_id — BIGINT — Primary key — NOT NULL
  • friendship_group_id — UUID — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • friend_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

home_card_comments

  • comment_id — BIGINT — Primary key — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • author_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • content — VARCHAR(30) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • deleted_at — TIMESTAMPTZ

home_card_likes

  • actor_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

home_card_slots

  • slot_no — SMALLINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • card_id — BIGINT — Foreign key → user_cards.card_id — NOT NULL

invitation_completions

  • new_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • inviter_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • invitation_id — BIGINT — Foreign key → invitations.invitation_id — NOT NULL
  • completed_at — TIMESTAMPTZ — NOT NULL
  • reward_date — DATE — NOT NULL
  • general_rewarded — BOOLEAN — NOT NULL

invitations

  • invitation_id — BIGINT — Primary key — NOT NULL
  • inviter_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • token_hash — VARCHAR(64) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • expires_at — TIMESTAMPTZ — NOT NULL
  • accepted_by — BIGINT — Foreign key → users.user_id
  • accepted_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL

media_files

  • media_file_id — BIGINT — Primary key — NOT NULL
  • upload_id — BIGINT — Foreign key → uploads.upload_id
  • bucket_type — VARCHAR(30) — NOT NULL
  • object_key — VARCHAR(1024) — NOT NULL
  • variant — VARCHAR(30) — NOT NULL
  • content_type — VARCHAR(100) — NOT NULL
  • file_size — BIGINT — NOT NULL
  • checksum_sha256 — CHAR(64)
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • deleted_at — TIMESTAMPTZ

opening_entitlements

  • entitlement_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • kind — VARCHAR(20) — NOT NULL
  • reason — VARCHAR(40) — NOT NULL
  • source_id — BIGINT — NOT NULL
  • unit_no — SMALLINT — NOT NULL
  • granted_at — TIMESTAMPTZ — NOT NULL
  • consumed_draw_id — BIGINT — Foreign key → draws.draw_id
  • claimed_at — TIMESTAMPTZ

pack_reward_claims

  • idempotency_key — UUID — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • reason — VARCHAR(40) — NOT NULL
  • through_entitlement_id — BIGINT — NOT NULL
  • claimed_count — INTEGER — NOT NULL
  • claimed_at — TIMESTAMPTZ — NOT NULL

signup_preparations

  • signup_id — VARCHAR(100) — Primary key — NOT NULL
  • expires_at — TIMESTAMPTZ — NOT NULL

signup_terms

  • term_id — BIGINT — Primary key — NOT NULL
  • code — VARCHAR(50) — NOT NULL
  • title — VARCHAR(200) — NOT NULL
  • version — VARCHAR(30) — NOT NULL
  • is_required — BOOLEAN — NOT NULL
  • document_url — VARCHAR(500)
  • display_order — INTEGER — NOT NULL
  • effective_from — TIMESTAMPTZ — NOT NULL
  • retired_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL

social_accounts

  • social_account_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • provider — VARCHAR(20) — NOT NULL
  • provider_user_id — VARCHAR(100) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL

social_notifications

  • notification_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • type — VARCHAR(32) — NOT NULL
  • actor_user_id — BIGINT — Foreign key → users.user_id
  • card_id — BIGINT — Foreign key → user_cards.card_id
  • comment_id — BIGINT — Foreign key → home_card_comments.comment_id
  • content — VARCHAR(30)
  • dedupe_key — VARCHAR(64) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • read_at — TIMESTAMPTZ
  • grant_batch_id — BIGINT — Foreign key → admin_pack_grant_batches.batch_id

solo_limited_draw_usages

  • draw_id — BIGINT — Foreign key → draws.draw_id — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • used_at — TIMESTAMPTZ — NOT NULL

uploads

  • upload_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id
  • signup_id — VARCHAR(64)
  • purpose — VARCHAR(30) — NOT NULL
  • requested_content_type — VARCHAR(100) — NOT NULL
  • requested_file_size — BIGINT — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • error_code — VARCHAR(50)
  • processing_owner — VARCHAR(100)
  • processing_lease_until — TIMESTAMPTZ
  • expires_at — TIMESTAMPTZ — NOT NULL
  • completed_at — TIMESTAMPTZ
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

user_cards

  • card_id — BIGINT — Primary key — NOT NULL
  • owner_user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • subject_user_id — BIGINT — Foreign key → users.user_id
  • card_asset_id — BIGINT — Foreign key → card_assets.card_asset_id
  • image_media_file_id — BIGINT — Foreign key → media_files.media_file_id — NOT NULL
  • display_name — VARCHAR(100) — NOT NULL
  • rarity_code — VARCHAR(20) — Foreign key → card_rarities.rarity_code
  • acquired_type — VARCHAR(20) — NOT NULL
  • acquired_at — TIMESTAMPTZ — NOT NULL
  • consumed_type — VARCHAR(20)
  • consumed_at — TIMESTAMPTZ
  • deleted_at — TIMESTAMPTZ
  • source_ai_generation_item_id — BIGINT — Foreign key → ai_generation_items.item_id
  • is_public — BOOLEAN — NOT NULL
  • gender_snapshot — VARCHAR(20) — NOT NULL
  • style_snapshot — VARCHAR(100)
  • anonymized — BOOLEAN — NOT NULL
  • anonymized_reason — VARCHAR(30)
  • cutout_media_file_id — BIGINT — Foreign key → media_files.media_file_id

user_term_agreements

  • agreement_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • term_id — BIGINT — Foreign key → signup_terms.term_id — NOT NULL
  • term_version — VARCHAR(30) — NOT NULL
  • agreed_at — TIMESTAMPTZ — NOT NULL

user_wallets

  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • coin_balance — INTEGER — NOT NULL
  • remaining_free_draws — INTEGER — NOT NULL
  • next_free_draw_at — TIMESTAMPTZ — NOT NULL
  • version — BIGINT — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL

users

  • user_id — BIGINT — Primary key — NOT NULL
  • nickname — VARCHAR(30) — NOT NULL
  • birth_date — DATE — NOT NULL
  • profile_media_file_id — BIGINT
  • signature_media_file_id — BIGINT
  • role — VARCHAR(20) — NOT NULL
  • status — VARCHAR(20) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL
  • updated_at — TIMESTAMPTZ — NOT NULL
  • deleted_at — TIMESTAMPTZ
  • nickname_active_key — VARCHAR(30)
  • gender — VARCHAR(20)
  • invitation_code — VARCHAR(8)
  • public_user_number — BIGINT — NOT NULL
  • signature_version — BIGINT — NOT NULL
  • ai_source_upload_id — BIGINT — Foreign key → uploads.upload_id

wallet_transactions

  • wallet_transaction_id — BIGINT — Primary key — NOT NULL
  • user_id — BIGINT — Foreign key → users.user_id — NOT NULL
  • type — VARCHAR(30) — NOT NULL
  • amount — INTEGER — NOT NULL
  • balance_after — INTEGER — NOT NULL
  • reference_type — VARCHAR(30) — NOT NULL
  • reference_id — VARCHAR(64) — NOT NULL
  • idempotency_key — VARCHAR(64) — NOT NULL
  • created_at — TIMESTAMPTZ — NOT NULL