user_account

-1 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
user_id uuid 2147483647 null
ai_candidate_decision_batch.decided_by fk_ai_candidate_decision_batch_actor_company R
ai_question.answered_by fk_ai_question_answered_by_company R
ai_run.requested_by fk_ai_run_requester_company R
approval_request.decided_by fk_approval_request_decider_company R
approval_request.requested_by fk_approval_request_requester_company R
document_ocr_run.requested_by fk_document_ocr_run_requester_company R
document_ocr_run.reviewed_by fk_document_ocr_run_reviewer_company R
external_submission.submitted_by fk_external_submission_actor_company R
notification.user_id Implied Constraint R
notification_preference.user_id fk_notification_preference_user_company C
outbox_manual_retry.requested_by fk_outbox_manual_retry_actor_company R
password_reset_token.user_id fk_password_reset_token_user_company R
refresh_token.user_id fk_refresh_token_user_company R
task.assignee_id fk_task_assignee_company R
task.created_by fk_task_created_by_company R
task.updated_by fk_task_updated_by_company R
task_checklist_item.completed_by fk_task_checklist_actor_company R
task_evidence.recorded_by fk_task_evidence_actor_company R
task_transition_history.actor_id fk_task_transition_actor_company R
user_agreement_consent.user_id fk_user_agreement_consent_user_company R
user_login_event.user_id fk_user_login_event_user_company C
worker_archive.archived_by fk_worker_archive_actor_company R
worker_document.archived_by fk_worker_document_archived_by_company R
worker_import_job.created_by fk_worker_import_job_creator_company R
worker_link.assignee_id fk_worker_link_assignee_company R
worker_link.issued_by fk_worker_link_issued_by_company R
worker_link.sent_by fk_worker_link_sent_by_company R
workflow_case.created_by fk_workflow_case_created_by_company R
company_id uuid 2147483647 null
ai_candidate_decision_batch.company_id fk_ai_candidate_decision_batch_actor_company R
ai_question.company_id fk_ai_question_answered_by_company R
ai_run.company_id fk_ai_run_requester_company R
approval_request.company_id fk_approval_request_requester_company R
document_ocr_run.company_id fk_document_ocr_run_reviewer_company R
external_submission.company_id fk_external_submission_actor_company R
notification_preference.company_id fk_notification_preference_user_company C
outbox_manual_retry.company_id fk_outbox_manual_retry_actor_company R
password_reset_token.company_id fk_password_reset_token_user_company R
refresh_token.company_id fk_refresh_token_user_company R
task.company_id fk_task_updated_by_company R
task_checklist_item.company_id fk_task_checklist_actor_company R
task_evidence.company_id fk_task_evidence_actor_company R
task_transition_history.company_id fk_task_transition_actor_company R
user_agreement_consent.company_id fk_user_agreement_consent_user_company R
user_login_event.company_id fk_user_login_event_user_company C
worker_archive.company_id fk_worker_archive_actor_company R
worker_document.company_id fk_worker_document_archived_by_company R
worker_import_job.company_id fk_worker_import_job_creator_company R
worker_link.company_id fk_worker_link_sent_by_company R
workflow_case.company_id fk_workflow_case_created_by_company R
company.company_id fk_user_account_company R
email varchar 254 null
normalized_email varchar 254 null
password_hash varchar 255 null
role varchar 20 null
status varchar 20 null
created_at timestamptz 35,6 CURRENT_TIMESTAMP
updated_at timestamptz 35,6 CURRENT_TIMESTAMP
version int8 19 0
display_name varchar 80 '사용자'::character varying
phone varchar 30 null
password_changed_at timestamptz 35,6 CURRENT_TIMESTAMP
failed_login_attempts int4 10 0
locked_until timestamptz 35,6 null
last_failed_login_at timestamptz 35,6 null
phone_ciphertext text 2147483647 null
phone_key_version varchar 60 null

Indexes

Constraint Name Type Sort Column(s)
pk_user_account Primary key Asc user_id
idx_user_account_company Performance Asc company_id
uq_user_account_normalized_email Must be unique Asc normalized_email
uq_user_account_user_company Must be unique Asc/Asc user_id + company_id

Check Constraints

Constraint Name Constraint
ck_user_account_password_hash_not_blank ((char_length(TRIM(BOTH FROM password_hash)) > 0))
ck_user_account_phone_cipher_pair ((((phone_ciphertext IS NULL) AND (phone_key_version IS NULL)) OR ((phone_ciphertext IS NOT NULL) AND (phone_key_version IS NOT NULL))))
ck_user_account_phone_single_storage (((phone IS NULL) OR (phone_ciphertext IS NULL)))
ck_user_account_email_not_blank ((char_length(TRIM(BOTH FROM email)) > 0))
ck_user_account_normalized_email (((normalized_email)::text = lower(TRIM(BOTH FROM email))))
ck_user_account_normalized_email_not_blank ((char_length(TRIM(BOTH FROM normalized_email)) > 0))
ck_user_account_version ((version >= 0))
ck_user_account_failed_login_attempts ((failed_login_attempts >= 0))
ck_user_account_updated_at ((updated_at >= created_at))
ck_user_account_display_name_not_blank ((char_length(TRIM(BOTH FROM display_name)) > 0))
ck_user_account_role (((role)::text = ANY ((ARRAY['ADMIN'::character varying, 'HR'::character varying, 'VIEWER'::character varying])::text[])))
ck_user_account_status (((status)::text = ANY ((ARRAY['ACTIVE'::character varying, 'SUSPENDED'::character varying, 'DISABLED'::character varying])::text[])))

Relationships