Constraints

85 Foreign Key Constraints

Constraint Name Child Column Parent Column Delete Rule
collection_article_id_foreign
collection.article_id
article.id
Restrict delete
collection_entrance_id_foreign
collection.entrance_id
article.id
Restrict delete
article_boost_article_id_foreign
article_boost.article_id
article.id
Restrict delete
transaction_recipient_id_foreign
transaction_obsolete.recipient_id
user.id
Restrict delete
transaction_sender_id_foreign
transaction_obsolete.sender_id
user.id
Restrict delete
feedback_asset_feedback_id_foreign
feedback_asset.feedback_id
feedback.id
Restrict delete
feedback_asset_asset_id_foreign
feedback_asset.asset_id
asset.id
Restrict delete
appreciation_recipient_id_foreign
appreciation.recipient_id
user.id
Restrict delete
appreciation_sender_id_foreign
appreciation.sender_id
user.id
Restrict delete
matters_today_article_id_foreign
matters_today.article_id
article.id
Restrict delete
user_oauth_user_id_foreign
user_oauth.user_id
user.id
Restrict delete
action_comment_user_id_foreign
action_comment.user_id
user.id
Restrict delete
action_comment_target_id_foreign
action_comment.target_id
comment.id
Restrict delete
customer_user_id_foreign
customer.user_id
user.id
Restrict delete
report_asset_asset_id_foreign
report_asset.asset_id
asset.id
Restrict delete
report_asset_report_id_foreign
report_asset.report_id
report.id
Restrict delete
user_oauth_likecoin_liker_id_foreign
user_oauth_likecoin.liker_id
user.liker_id
Restrict delete
payout_account_user_id_foreign
payout_account.user_id
user.id
Restrict delete
action_article_user_id_foreign
action_article.user_id
user.id
Restrict delete
action_article_target_id_foreign
action_article.target_id
article.id
Restrict delete
verification_code_user_id_foreign
verification_code.user_id
user.id
Restrict delete
tag_boost_tag_id_foreign
tag_boost.tag_id
tag.id
Restrict delete
punish_record_user_id_foreign
punish_record.user_id
user.id
Restrict delete
matters_choice_article_id_foreign
matters_choice.article_id
article.id
Restrict delete
release_cover_foreign
release.cover
asset.id
Restrict delete
action_tag_user_id_foreign
action_tag.user_id
user.id
Restrict delete
action_tag_target_id_foreign
action_tag.target_id
tag.id
Restrict delete
invitation_sender_id_foreign
invitation.sender_id
user.id
Restrict delete
invitation_recipient_id_foreign
invitation.recipient_id
user.id
Restrict delete
notice_actor_notice_id_foreign
notice_actor.notice_id
notice.id
Restrict delete
notice_actor_actor_id_foreign
notice_actor.actor_id
user.id
Restrict delete
username_edit_history_user_id_foreign
username_edit_history.user_id
user.id
Restrict delete
comment_mentioned_user_comment_id_foreign
comment_mentioned_user.comment_id
comment.id
Restrict delete
comment_mentioned_user_user_id_foreign
comment_mentioned_user.user_id
user.id
Restrict delete
oauth_client_avatar_foreign
oauth_client.avatar
asset.id
Restrict delete
oauth_client_user_id_foreign
oauth_client.user_id
user.id
Restrict delete
oauth_access_token_client_id_foreign
oauth_access_token.client_id
oauth_client.id
Restrict delete
oauth_access_token_user_id_foreign
oauth_access_token.user_id
user.id
Restrict delete
article_tag_tag_id_foreign
article_tag.tag_id
tag.id
Restrict delete
article_tag_article_id_foreign
article_tag.article_id
article.id
Restrict delete
feedback_user_id_foreign
feedback.user_id
user.id
Restrict delete
article_read_article_id_foreign
article_read.article_id
article.id
Restrict delete
article_read_user_id_foreign
article_read.user_id
user.id
Restrict delete
notice_notice_detail_id_foreign
notice.notice_detail_id
notice_detail.id
Restrict delete
notice_recipient_id_foreign
notice.recipient_id
user.id
Restrict delete
user_notify_setting_user_id_foreign
user_notify_setting.user_id
user.id
Restrict delete
action_user_user_id_foreign
action_user.user_id
user.id
Restrict delete
action_user_target_id_foreign
action_user.target_id
user.id
Restrict delete
transaction_recipient_id_foreign
transaction.recipient_id
user.id
Restrict delete
transaction_target_type_foreign
transaction.target_type
entity_type.id
Restrict delete
transaction_sender_id_foreign
transaction.sender_id
user.id
Restrict delete
article_recommend_setting_article_id_foreign
article_recommend_setting.article_id
article.id
Restrict delete
comment_author_id_foreign
comment.author_id
user.id
Restrict delete
comment_article_id_foreign
comment.article_id
article.id
Restrict delete
comment_reply_to_foreign
comment.reply_to
comment.id
Restrict delete
comment_parent_comment_id_foreign
comment.parent_comment_id
comment.id
Restrict delete
user_badge_user_id_foreign
user_badge.user_id
user.id
Restrict delete
push_device_user_id_foreign
push_device.user_id
user.id
Restrict delete
audio_draft_author_id_foreign
audio_draft.author_id
user.id
Restrict delete
audio_draft_audio_foreign
audio_draft.audio
asset.id
Restrict delete
asset_map_asset_id_foreign
asset_map.asset_id
asset.id
Restrict delete
asset_map_entity_type_id_foreign
asset_map.entity_type_id
entity_type.id
Restrict delete
article_read_count_user_id_foreign
article_read_count.user_id
user.id
Restrict delete
article_read_count_article_id_foreign
article_read_count.article_id
article.id
Restrict delete
notice_entity_notice_id_foreign
notice_entity.notice_id
notice.id
Restrict delete
notice_entity_entity_type_id_foreign
notice_entity.entity_type_id
entity_type.id
Restrict delete
log_record_user_id_foreign
log_record.user_id
user.id
Restrict delete
draft_cover_foreign
draft.cover
asset.id
Restrict delete
draft_author_id_foreign
draft.author_id
user.id
Restrict delete
draft_upstream_id_foreign
draft.upstream_id
article.id
Restrict delete
user_boost_user_id_foreign
user_boost.user_id
user.id
Restrict delete
asset_author_id_foreign
asset.author_id
user.id
Restrict delete
report_article_id_foreign
report.article_id
article.id
Restrict delete
report_user_id_foreign
report.user_id
user.id
Restrict delete
report_comment_id_foreign
report.comment_id
comment.id
Restrict delete
user_avatar_foreign
user.avatar
asset.id
Restrict delete
oauth_refresh_token_user_id_foreign
oauth_refresh_token.user_id
user.id
Restrict delete
oauth_refresh_token_client_id_foreign
oauth_refresh_token.client_id
oauth_client.id
Restrict delete
oauth_authorization_code_client_id_foreign
oauth_authorization_code.client_id
oauth_client.id
Restrict delete
oauth_authorization_code_user_id_foreign
oauth_authorization_code.user_id
user.id
Restrict delete
article_cover_foreign
article.cover
asset.id
Restrict delete
article_author_id_foreign
article.author_id
user.id
Restrict delete
article_upstream_id_foreign
article.upstream_id
article.id
Restrict delete
article_draft_id_foreign
article.draft_id
draft.id
Restrict delete
serach_history_user_id_foreign
search_history.user_id
user.id
Restrict delete

Check Constraints

Table Constraint Name Constraint
transaction_obsolete transaction_purpose_check ((purpose = ANY (ARRAY['appreciate'::text, 'appreciate-comment'::text, 'appreciate-subsidy'::text, 'invitation-accepted'::text, 'join-by-invitation'::text, 'join-by-task'::text, 'first-post'::text, 'system-subsidy'::text])))
transaction_obsolete transaction_type_check ((type = ANY (ARRAY['LIKE'::text, 'MAT'::text])))
appreciation appreciation_purpose_check ((purpose = ANY (ARRAY['appreciate'::text, 'appreciate-comment'::text, 'appreciate-subsidy'::text, 'invitation-accepted'::text, 'join-by-invitation'::text, 'join-by-task'::text, 'first-post'::text, 'system-subsidy'::text])))
appreciation appreciation_type_check ((type = ANY (ARRAY['LIKE'::text, 'MAT'::text])))
user_oauth user_oauth_provider_check ((provider = ANY (ARRAY['facebook'::text, 'google'::text, 'medium'::text])))
action_comment action_comment_action_check ((action = ANY (ARRAY['up_vote'::text, 'down_vote'::text])))
customer customer_provider_check ((provider = 'stripe'::text))
user_oauth_likecoin user_oauth_likecoin_account_type_check ((account_type = ANY (ARRAY['temporal'::text, 'general'::text])))
payout_account payout_account_provider_check ((provider = 'stripe'::text))
payout_account payout_account_type_check ((type = ANY (ARRAY['express'::text, 'standard'::text])))
action_article action_article_action_check ((action = 'subscribe'::text))
verification_code verification_code_status_check ((status = ANY (ARRAY['active'::text, 'inactive'::text, 'verified'::text, 'expired'::text, 'used'::text])))
verification_code verification_code_type_check ((type = ANY (ARRAY['register'::text, 'email_reset'::text, 'email_reset_confirm'::text, 'password_reset'::text, 'payment_password_reset'::text, 'email_verify'::text])))
punish_record punish_record_state_check ((state = 'banned'::text))
blocklist blocklist_type_check ((type = ANY (ARRAY['agent_hash'::text, 'email'::text, 'domain'::text])))
release release_channel_check ((channel = ANY (ARRAY['appStore'::text, 'googlePlay'::text])))
release release_platform_check ((platform = ANY (ARRAY['ios'::text, 'android'::text])))
action_tag action_tag_action_check ((action = 'follow'::text))
invitation invitation_status_check ((status = ANY (ARRAY['pending'::text, 'activated'::text])))
action_user action_user_action_check ((action = ANY (ARRAY['follow'::text, 'rate'::text, 'block'::text])))
transaction transaction_currency_check ((currency = ANY (ARRAY['HKD'::text, 'LIKE'::text])))
transaction transaction_provider_check ((provider = ANY (ARRAY['stripe'::text, 'likecoin'::text, 'matters'::text])))
transaction transaction_purpose_check ((purpose = ANY (ARRAY['appreciate'::text, 'appreciate-comment'::text, 'appreciate-subsidy'::text, 'invitation-accepted'::text, 'join-by-invitation'::text, 'join-by-task'::text, 'first-post'::text, 'system-subsidy'::text])))
transaction transaction_state_check ((state = ANY (ARRAY['pending'::text, 'succeeded'::text, 'failed'::text, 'canceled'::text])))
comment comment_state_check ((state = ANY (ARRAY['active'::text, 'archived'::text, 'banned'::text, 'collapsed'::text])))
user_badge user_badge_type_check ((type = 'seed'::text))
push_device push_device_platform_check ((platform = ANY (ARRAY['ios'::text, 'android'::text, 'web'::text])))
push_device push_device_provider_check ((provider = ANY (ARRAY['jpush'::text, 'fcm'::text])))
feature_flag feature_flag_flag_check ((flag = ANY (ARRAY['on'::text, 'off'::text, 'admin'::text])))
draft draft_publish_state_check ((publish_state = ANY (ARRAY['unpublished'::text, 'pending'::text, 'published'::text, 'error'::text])))
user user_language_check ((language = ANY (ARRAY['zh_hant'::text, 'zh_hans'::text, 'en'::text])))
user user_role_check ((role = ANY (ARRAY['user'::text, 'admin'::text])))
user user_state_check ((state = ANY (ARRAY['onboarding'::text, 'active'::text, 'banned'::text, 'frozen'::text, 'archived'::text])))
article article_state_check ((state = ANY (ARRAY['active'::text, 'banned'::text, 'archived'::text])))