dify

Tables (54)

account_integrates

  • id — uuid — Primary key — NOT NULL
  • account_id — uuid — NOT NULL
  • provider — varchar(16) — NOT NULL
  • open_id — varchar(255) — NOT NULL
  • encrypted_token — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

accounts

  • id — uuid — Primary key — NOT NULL
  • name — varchar(255) — NOT NULL — 이름
  • email — varchar(255) — NOT NULL
  • password — varchar(255)
  • password_salt — varchar(255)
  • avatar — varchar(255)
  • interface_language — varchar(255)
  • interface_theme — varchar(255)
  • timezone — varchar(255)
  • last_login_at — timestamp
  • last_login_ip — varchar(255)
  • status — varchar(16) — NOT NULL
  • initialized_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • last_active_at — timestamp — NOT NULL

alembic_version

  • version_num — varchar(32) — Primary key — NOT NULL
  • Key — Primary key — NOT NULL
  • Field

api_based_extensions

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • name — varchar(255) — NOT NULL
  • api_endpoint — varchar(255) — NOT NULL
  • api_key — text — NOT NULL
  • created_at — timestamp — NOT NULL

api_requests

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • api_token_id — uuid — NOT NULL
  • path — varchar(255) — NOT NULL
  • request — text
  • response — text
  • ip — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL

api_tokens

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid
  • type — varchar(16) — NOT NULL
  • token — varchar(255) — NOT NULL
  • last_used_at — timestamp
  • created_at — timestamp — NOT NULL
  • tenant_id — uuid

app_annotation_hit_histories

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • annotation_id — uuid — NOT NULL
  • source — text — NOT NULL
  • question — text — NOT NULL
  • account_id — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • score — float8 — NOT NULL
  • message_id — uuid — NOT NULL
  • annotation_question — text — NOT NULL
  • annotation_content — text — NOT NULL

app_annotation_settings

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • score_threshold — float8 — NOT NULL
  • collection_binding_id — uuid — NOT NULL
  • created_user_id — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_user_id — uuid — NOT NULL
  • updated_at — timestamp — NOT NULL

app_dataset_joins

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • dataset_id — uuid — NOT NULL
  • created_at — timestamp — NOT NULL

app_model_configs

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • provider — varchar(255) — NOT NULL
  • model_id — varchar(255) — NOT NULL
  • configs — json — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • opening_statement — text
  • suggested_questions — text
  • suggested_questions_after_answer — text
  • more_like_this — text
  • model — text
  • user_input_form — text
  • pre_prompt — text
  • agent_mode — text
  • speech_to_text — text
  • sensitive_word_avoidance — text
  • retriever_resource — text
  • dataset_query_variable — varchar(255)
  • prompt_type — varchar(255) — NOT NULL
  • chat_prompt_config — text
  • completion_prompt_config — text
  • dataset_configs — text
  • external_data_tools — text
  • file_upload — text
  • text_to_speech — text

apps

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • name — varchar(255) — NOT NULL
  • mode — varchar(255) — NOT NULL
  • icon — varchar(255)
  • icon_background — varchar(255)
  • app_model_config_id — uuid
  • status — varchar(255) — NOT NULL
  • enable_site — bool — NOT NULL
  • enable_api — bool — NOT NULL
  • api_rpm — int4 — NOT NULL
  • api_rph — int4 — NOT NULL
  • is_demo — bool — NOT NULL
  • is_public — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • is_universal — bool — NOT NULL

celery_taskmeta

  • id — int4 — Primary key — NOT NULL
  • task_id — varchar(155)
  • status — varchar(50)
  • result — bytea
  • date_done — timestamp
  • traceback — text
  • name — varchar(155)
  • args — bytea
  • kwargs — bytea
  • worker — varchar(155)
  • retries — int4
  • queue — varchar(155)

celery_tasksetmeta

  • id — int4 — Primary key — NOT NULL
  • taskset_id — varchar(155)
  • result — bytea
  • date_done — timestamp

conversations

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • app_model_config_id — uuid — NOT NULL
  • model_provider — varchar(255) — NOT NULL
  • override_model_configs — text
  • model_id — varchar(255) — NOT NULL
  • mode — varchar(255) — NOT NULL
  • name — varchar(255) — NOT NULL
  • summary — text
  • inputs — json
  • introduction — text
  • system_instruction — text
  • system_instruction_tokens — int4 — NOT NULL
  • status — varchar(255) — NOT NULL
  • from_source — varchar(255) — NOT NULL
  • from_end_user_id — uuid
  • from_account_id — uuid
  • read_at — timestamp
  • read_account_id — uuid
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • is_deleted — bool — NOT NULL

data_source_bindings

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • access_token — varchar(255) — NOT NULL
  • provider — varchar(255) — NOT NULL
  • source_info — jsonb — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • disabled — bool

dataset_collection_bindings

  • id — uuid — Primary key — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • model_name — varchar(40) — NOT NULL
  • collection_name — varchar(64) — NOT NULL
  • created_at — timestamp — NOT NULL
  • type — varchar(40) — NOT NULL

dataset_keyword_tables

  • id — uuid — Primary key — NOT NULL
  • dataset_id — uuid — NOT NULL
  • keyword_table — text — NOT NULL

dataset_process_rules

  • id — uuid — Primary key — NOT NULL
  • dataset_id — uuid — NOT NULL
  • mode — varchar(255) — NOT NULL
  • rules — text
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL

dataset_queries

  • id — uuid — Primary key — NOT NULL
  • dataset_id — uuid — NOT NULL
  • content — text — NOT NULL
  • source — varchar(255) — NOT NULL
  • source_app_id — uuid
  • created_by_role — varchar — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL

dataset_retriever_resources

  • id — uuid — Primary key — NOT NULL
  • message_id — uuid — NOT NULL
  • position — int4 — NOT NULL
  • dataset_id — uuid — NOT NULL
  • dataset_name — text — NOT NULL
  • document_id — uuid — NOT NULL
  • document_name — text — NOT NULL
  • data_source_type — text — NOT NULL
  • segment_id — uuid — NOT NULL
  • score — float8
  • content — text — NOT NULL
  • hit_count — int4
  • word_count — int4
  • segment_position — int4
  • index_node_hash — text
  • retriever_from — text — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL

datasets

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • name — varchar(255) — NOT NULL
  • description — text
  • provider — varchar(255) — NOT NULL
  • permission — varchar(255) — NOT NULL
  • data_source_type — varchar(255)
  • indexing_technique — varchar(255)
  • index_struct — text
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_by — uuid
  • updated_at — timestamp — NOT NULL
  • embedding_model — varchar(255)
  • embedding_model_provider — varchar(255)
  • collection_binding_id — uuid
  • retrieval_model — jsonb

dify_setups

  • version — varchar(255) — Primary key — NOT NULL
  • setup_at — timestamp — NOT NULL

document_segments

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • dataset_id — uuid — NOT NULL
  • document_id — uuid — NOT NULL
  • position — int4 — NOT NULL
  • content — text — NOT NULL
  • word_count — int4 — NOT NULL
  • tokens — int4 — NOT NULL
  • keywords — json
  • index_node_id — varchar(255)
  • index_node_hash — varchar(255)
  • hit_count — int4 — NOT NULL
  • enabled — bool — NOT NULL
  • disabled_at — timestamp
  • disabled_by — uuid
  • status — varchar(255) — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • indexing_at — timestamp
  • completed_at — timestamp
  • error — text
  • stopped_at — timestamp
  • answer — text
  • updated_by — uuid
  • updated_at — timestamp — NOT NULL

documents

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • dataset_id — uuid — NOT NULL
  • position — int4 — NOT NULL
  • data_source_type — varchar(255) — NOT NULL
  • data_source_info — text
  • dataset_process_rule_id — uuid
  • batch — varchar(255) — NOT NULL
  • name — varchar(255) — NOT NULL
  • created_from — varchar(255) — NOT NULL
  • created_by — uuid — NOT NULL
  • created_api_request_id — uuid
  • created_at — timestamp — NOT NULL
  • processing_started_at — timestamp
  • file_id — text
  • word_count — int4
  • parsing_completed_at — timestamp
  • cleaning_completed_at — timestamp
  • splitting_completed_at — timestamp
  • tokens — int4
  • indexing_latency — float8
  • completed_at — timestamp
  • is_paused — bool
  • paused_by — uuid
  • paused_at — timestamp
  • error — text
  • stopped_at — timestamp
  • indexing_status — varchar(255) — NOT NULL
  • enabled — bool — NOT NULL
  • disabled_at — timestamp
  • disabled_by — uuid
  • archived — bool — NOT NULL
  • archived_reason — varchar(255)
  • archived_by — uuid
  • archived_at — timestamp
  • updated_at — timestamp — NOT NULL
  • doc_type — varchar(40)
  • doc_metadata — json
  • doc_form — varchar(255) — NOT NULL
  • doc_language — varchar(255)

embeddings

  • id — uuid — Primary key — NOT NULL
  • hash — varchar(64) — NOT NULL
  • embedding — bytea — NOT NULL
  • created_at — timestamp — NOT NULL
  • model_name — varchar(40) — NOT NULL

end_users

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • app_id — uuid
  • type — varchar(255) — NOT NULL
  • external_user_id — varchar(255)
  • name — varchar(255)
  • is_anonymous — bool — NOT NULL
  • session_id — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

installed_apps

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • app_id — uuid — NOT NULL
  • app_owner_tenant_id — uuid — NOT NULL
  • position — int4 — NOT NULL
  • is_pinned — bool — NOT NULL
  • last_used_at — timestamp
  • created_at — timestamp — NOT NULL

invitation_codes

  • id — serial4 — Primary key — NOT NULL
  • batch — varchar(255) — NOT NULL
  • code — varchar(32) — NOT NULL
  • status — varchar(16) — NOT NULL
  • used_at — timestamp
  • used_by_tenant_id — uuid
  • used_by_account_id — uuid
  • deprecated_at — timestamp
  • created_at — timestamp — NOT NULL

message_agent_thoughts

  • id — uuid — Primary key — NOT NULL
  • message_id — uuid — NOT NULL
  • message_chain_id — uuid
  • position — int4 — NOT NULL
  • thought — text
  • tool — text
  • tool_input — text
  • observation — text
  • tool_process_data — text
  • message — text
  • message_token — int4
  • message_unit_price — numeric
  • answer — text
  • answer_token — int4
  • answer_unit_price — numeric
  • tokens — int4
  • total_price — numeric
  • currency — varchar
  • latency — float8
  • created_by_role — varchar — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • message_price_unit — numeric(10, 7) — NOT NULL
  • answer_price_unit — numeric(10, 7) — NOT NULL
  • message_files — text
  • tool_labels_str — text — NOT NULL

message_annotations

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • conversation_id — uuid
  • message_id — uuid
  • content — text — NOT NULL
  • account_id — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • question — text
  • hit_count — int4 — NOT NULL

message_chains

  • id — uuid — Primary key — NOT NULL
  • message_id — uuid — NOT NULL
  • type — varchar(255) — NOT NULL
  • input — text
  • output — text
  • created_at — timestamp — NOT NULL

message_feedbacks

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • conversation_id — uuid — NOT NULL
  • message_id — uuid — NOT NULL
  • rating — varchar(255) — NOT NULL
  • content — text
  • from_source — varchar(255) — NOT NULL
  • from_end_user_id — uuid
  • from_account_id — uuid
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

message_files

  • id — uuid — Primary key — NOT NULL
  • message_id — uuid — NOT NULL
  • type — varchar(255) — NOT NULL
  • transfer_method — varchar(255) — NOT NULL
  • url — text
  • upload_file_id — uuid
  • created_by_role — varchar(255) — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • belongs_to — varchar(255)

messages

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • model_provider — varchar(255) — NOT NULL
  • model_id — varchar(255) — NOT NULL
  • override_model_configs — text
  • conversation_id — uuid — NOT NULL
  • inputs — json
  • query — text — NOT NULL
  • message — json — NOT NULL
  • message_tokens — int4 — NOT NULL
  • message_unit_price — numeric(10, 4) — NOT NULL
  • answer — text — NOT NULL
  • answer_tokens — int4 — NOT NULL
  • answer_unit_price — numeric(10, 4) — NOT NULL
  • provider_response_latency — float8 — NOT NULL
  • total_price — numeric(10, 7)
  • currency — varchar(255) — NOT NULL
  • from_source — varchar(255) — NOT NULL
  • from_end_user_id — uuid
  • from_account_id — uuid
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • agent_based — bool — NOT NULL
  • message_price_unit — numeric(10, 7) — NOT NULL
  • answer_price_unit — numeric(10, 7) — NOT NULL

operation_logs

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • account_id — uuid — NOT NULL
  • action — varchar(255) — NOT NULL
  • content — json
  • created_at — timestamp — NOT NULL
  • created_ip — varchar(255) — NOT NULL
  • updated_at — timestamp — NOT NULL

pinned_conversations

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • conversation_id — uuid — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • created_by_role — varchar(255) — NOT NULL

provider_models

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • model_name — varchar(255) — NOT NULL
  • model_type — varchar(40) — NOT NULL
  • encrypted_config — text
  • is_valid — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

provider_orders

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • account_id — uuid — NOT NULL
  • payment_product_id — varchar(191) — NOT NULL
  • payment_id — varchar(191)
  • transaction_id — varchar(191)
  • quantity — int4 — NOT NULL
  • currency — varchar(40)
  • total_amount — int4
  • payment_status — varchar(40) — NOT NULL
  • paid_at — timestamp
  • pay_failed_at — timestamp
  • refunded_at — timestamp
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

providers

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • provider_type — varchar(40) — NOT NULL
  • encrypted_config — text
  • is_valid — bool — NOT NULL
  • last_used — timestamp
  • quota_type — varchar(40)
  • quota_limit — int8
  • quota_used — int8
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

recommended_apps

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • description — json — NOT NULL
  • copyright — varchar(255) — NOT NULL
  • privacy_policy — varchar(255) — NOT NULL
  • category — varchar(255) — NOT NULL
  • position — int4 — NOT NULL
  • is_listed — bool — NOT NULL
  • install_count — int4 — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • language — varchar(255) — NOT NULL

saved_messages

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • message_id — uuid — NOT NULL
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • created_by_role — varchar(255) — NOT NULL

sites

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — NOT NULL
  • title — varchar(255) — NOT NULL
  • icon — varchar(255)
  • icon_background — varchar(255)
  • description — text
  • default_language — varchar(255) — NOT NULL
  • copyright — varchar(255)
  • privacy_policy — varchar(255)
  • customize_domain — varchar(255)
  • customize_token_strategy — varchar(255) — NOT NULL
  • prompt_public — bool — NOT NULL
  • status — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • code — varchar(255)

tenant_account_joins

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • account_id — uuid — NOT NULL
  • role — varchar(16) — NOT NULL
  • invited_by — uuid
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • current — bool — NOT NULL

tenant_default_models

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • model_name — varchar(40) — NOT NULL
  • model_type — varchar(40) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tenant_preferred_model_providers

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider_name — varchar(40) — NOT NULL
  • preferred_provider_type — varchar(40) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tenants

  • id — uuid — Primary key — NOT NULL
  • name — varchar(255) — NOT NULL
  • encrypt_public_key — text
  • plan — varchar(255) — NOT NULL
  • status — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • custom_config — text

tool_api_providers

  • id — uuid — Primary key — NOT NULL
  • name — varchar(40) — NOT NULL
  • schema — text — NOT NULL
  • schema_type_str — varchar(40) — NOT NULL
  • user_id — uuid — NOT NULL
  • tenant_id — uuid — NOT NULL
  • tools_str — text — NOT NULL
  • icon — varchar(255) — NOT NULL
  • credentials_str — text — NOT NULL
  • description — text — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL
  • privacy_policy — varchar(255)

tool_builtin_providers

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid
  • user_id — uuid — NOT NULL
  • provider — varchar(40) — NOT NULL
  • encrypted_credentials — text
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tool_conversation_variables

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — NOT NULL
  • tenant_id — uuid — NOT NULL
  • conversation_id — uuid — NOT NULL
  • variables_str — text — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tool_files

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — NOT NULL
  • tenant_id — uuid — NOT NULL
  • conversation_id — uuid — NOT NULL
  • file_key — varchar(255) — NOT NULL
  • mimetype — varchar(255) — NOT NULL
  • original_url — varchar(255)

tool_model_invokes

  • id — uuid — Primary key — NOT NULL
  • user_id — uuid — NOT NULL
  • tenant_id — uuid — NOT NULL
  • provider — varchar(40) — NOT NULL
  • tool_type — varchar(40) — NOT NULL
  • tool_name — varchar(40) — NOT NULL
  • model_parameters — text — NOT NULL
  • prompt_messages — text — NOT NULL
  • model_response — text — NOT NULL
  • prompt_tokens — int4 — NOT NULL
  • answer_tokens — int4 — NOT NULL
  • answer_unit_price — numeric(10, 4) — NOT NULL
  • answer_price_unit — numeric(10, 7) — NOT NULL
  • provider_response_latency — float8 — NOT NULL
  • total_price — numeric(10, 7)
  • currency — varchar(255) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tool_providers

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • tool_name — varchar(40) — NOT NULL
  • encrypted_credentials — text
  • is_enabled — bool — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

tool_published_apps

  • id — uuid — Primary key — NOT NULL
  • app_id — uuid — Foreign key → apps.id — NOT NULL
  • user_id — uuid — NOT NULL
  • description — text — NOT NULL
  • llm_description — text — NOT NULL
  • query_description — text — NOT NULL
  • query_name — varchar(40) — NOT NULL
  • tool_name — varchar(40) — NOT NULL
  • author — varchar(40) — NOT NULL
  • created_at — timestamp — NOT NULL
  • updated_at — timestamp — NOT NULL

upload_files

  • id — uuid — Primary key — NOT NULL
  • tenant_id — uuid — NOT NULL
  • storage_type — varchar(255) — NOT NULL
  • key — varchar(255) — NOT NULL
  • name — varchar(255) — NOT NULL
  • size — int4 — NOT NULL
  • extension — varchar(255) — NOT NULL
  • mime_type — varchar(255)
  • created_by — uuid — NOT NULL
  • created_at — timestamp — NOT NULL
  • used — bool — NOT NULL
  • used_by — uuid
  • used_at — timestamp
  • hash — varchar(255)
  • created_by_role — varchar(255) — NOT NULL