Constraints

61 Foreign Key Constraints

Constraint Name Child Column Parent Column Delete Rule
DeletedPosts_DeleteUserId_fkey
DeletedPosts.DeleteUserId
Users.id
Cascade on delete
DeletedPosts_UserId_fkey
DeletedPosts.UserId
Users.id
Cascade on delete
DeletedPosts_GroupId_fkey
DeletedPosts.GroupId
Groups.id
Cascade on delete
ReportedUsers_ContentId_fkey
ReportedUsers.ContentId
Contents.id
Cascade on delete
ReportedUsers_UserId_fkey
ReportedUsers.UserId
Users.id
Cascade on delete
ReportedUsers_ReportReasonId_fkey
ReportedUsers.ReportReasonId
ReportUserReasons.id
Cascade on delete
ReportedUsers_ReporterUserId_fkey
ReportedUsers.ReporterUserId
Users.id
Cascade on delete
PostShares_PostId_fkey
PostShares.PostId
Posts.id
Null on delete
PostShares_ShareId_fkey
PostShares.ShareId
Shares.id
Restrict delete
Groups_UserId_fkey
Groups.UserId
Users.id
Restrict delete
Groups_GroupTypeId_fkey
Groups.GroupTypeId
GroupTypes.id
Restrict delete
ContentScores_ContentId_fkey
ContentScores.ContentId
Contents.id
Cascade on delete
ContentScores_CategoryId_fkey
ContentScores.CategoryId
ParameterCategories.id
Cascade on delete
ContentScores_ParameterId_fkey
ContentScores.ParameterId
ScoreParameters.id
Cascade on delete
BlackListedContents_ContentId_fkey
BlackListedContents.ContentId
Contents.id
Cascade on delete
BlackListedContents_ReporterId_fkey
BlackListedContents.ReporterId
Users.id
Null on delete
BannerHashtags_HashtagId_fkey
BannerHashtags.HashtagId
Hashtags.id
Restrict delete
BannerHashtags_BannerId_fkey
BannerHashtags.BannerId
Banners.id
Restrict delete
MyGroupNewPostsNotifications_NotificationId_fkey
MyGroupNewPostsNotifications.NotificationId
Notifications.id
Cascade on delete
CMSContentOverallScores_ContentId_fkey
CMSContentOverallScores.ContentId
Contents.id
Cascade on delete
GroupShares_GroupId_fkey
GroupShares.GroupId
Groups.id
Null on delete
GroupShares_ShareId_fkey
GroupShares.ShareId
Shares.id
Restrict delete
BlackListedContentBlackListedWords_BlackListedWordId_fkey
BlackListedContentBlackListedWords.BlackListedWordId
BlackListedWords.id
Cascade on delete
BlackListedContentBlackListedWords_BlackListedContentId_fkey
BlackListedContentBlackListedWords.BlackListedContentId
BlackListedContents.id
Cascade on delete
ReplyNotifications_NotificationId_fkey
ReplyNotifications.NotificationId
Notifications.id
Cascade on delete
ReplyNotifications_ReplyId_fkey
ReplyNotifications.ReplyId
Replies.id
Restrict delete
Attachments_ContentId_fkey
Attachments.ContentId
Contents.id
Cascade on delete
Attachments_id_fkey
Attachments.id
Contents.id
Cascade on delete
Attachments_UserId_fkey
Attachments.UserId
Users.id
Cascade on delete
Bookmarks_UserId_fkey
Bookmarks.UserId
Users.id
Cascade on delete
Bookmarks_ContentId_fkey
Bookmarks.ContentId
Contents.id
Cascade on delete
MyGroupNewPostsNotificationTo_myGroupNewPostsNotificationI_fkey
MyGroupNewPostsNotificationTopGroups.myGroupNewPostsNotificationId
MyGroupNewPostsNotifications.NotificationId
Cascade on delete
MyGroupNewPostsNotificationTopGroups_groupId_fkey
MyGroupNewPostsNotificationTopGroups.groupId
Groups.id
Cascade on delete
DeletedPostNotifications_NotificationId_fkey
DeletedPostNotifications.NotificationId
Notifications.id
Cascade on delete
DeletedPostNotifications_DeletedPostId_fkey
DeletedPostNotifications.DeletedPostId
DeletedPosts.id
Restrict delete
Replies_CMSCreatorId_fkey
Replies.CMSCreatorId
Users.id
Null on delete
Replies_RootContentId_fkey
Replies.RootContentId
Contents.id
Cascade on delete
Replies_ParentReplyId_fkey
Replies.ParentReplyId
Replies.id
Cascade on delete
Replies_id_fkey
Replies.id
Contents.id
Cascade on delete
Replies_UserId_fkey
Replies.UserId
Users.id
Null on delete
Reactions_ContentId_fkey
Reactions.ContentId
Contents.id
Cascade on delete
Reactions_UserId_fkey
Reactions.UserId
Users.id
Cascade on delete
GroupDeletionNotifications_NotificationId_fkey
GroupDeletionNotifications.NotificationId
Notifications.id
Cascade on delete
Publishers_CreatorId_fkey
Publishers.CreatorId
Users.id
Null on delete
Publishers_UserId_fkey
Publishers.UserId
Users.id
Cascade on delete
BlockedUsers_BlockerUserId_fkey
BlockedUsers.BlockerUserId
Users.id
Cascade on delete
BlockedUsers_BlockedUserId_fkey
BlockedUsers.BlockedUserId
Users.id
Cascade on delete
ReportNotifications_ReportId_fkey
ReportNotifications.ReportId
ReportedUsers.id
Cascade on delete
ReportNotifications_NotificationId_fkey
ReportNotifications.NotificationId
Notifications.id
Cascade on delete
GroupRenameNotifications_NotificationId_fkey
GroupRenameNotifications.NotificationId
Notifications.id
Cascade on delete
GroupRenameNotifications_GroupId_fkey
GroupRenameNotifications.GroupId
Groups.id
Cascade on delete
ParameterCategories_ParameterId_fkey
ParameterCategories.ParameterId
ScoreParameters.id
Cascade on delete
TopicTabHashtags_HashtagId_fkey
TopicTabHashtags.HashtagId
Hashtags.id
Restrict delete
TopicTabHashtags_TopicTabId_fkey
TopicTabHashtags.TopicTabId
TopicTabs.id
Restrict delete
GroupUsers_GroupId_fkey
GroupUsers.GroupId
Groups.id
Restrict delete
GroupUsers_UserId_fkey
GroupUsers.UserId
Users.id
Restrict delete
ReactionNotifications_NotificationId_fkey
ReactionNotifications.NotificationId
Notifications.id
Cascade on delete
ReactionNotifications_ReactionId_fkey
ReactionNotifications.ReactionId
Reactions.id
Restrict delete
Posts_UserId_fkey
Posts.UserId
Users.id
Null on delete
Posts_GroupId_fkey
Posts.GroupId
Groups.id
Restrict delete
Posts_id_fkey
Posts.id
Contents.id
Cascade on delete

Check Constraints

Table Constraint Name Constraint
DeletedPosts check_post_note (((reason <> 'OTHER'::"enum_DeletedPosts_reason") OR ((reason = 'OTHER'::"enum_DeletedPosts_reason") AND (note IS NOT NULL))))
DeletedPosts check_post_title ((((type = 'STANDARD'::gcud."enum_Posts_type") AND (title IS NULL)) OR ((type = 'QUESTION'::gcud."enum_Posts_type") AND (title IS NOT NULL))))
ReportedUsers UserId_ReporterUserId_check (("UserId" <> "ReporterUserId"))
TopicTabs order_positive_only (("order" > 0))
MyGroupNewPostsNotifications gcud_MyGroupNewPostsNotifications_newPostsStartTime_before_newP (("newPostsStartTime" < "newPostsEndTime"))
MyGroupNewPostsNotifications MyGroupNewPostsNotifications_myGroupsCount_check (("myGroupsCount" > 0))
MyGroupNewPostsNotifications MyGroupNewPostsNotifications_newPostsCount_check (("newPostsCount" > 0))
Banners order_positive_only (("order" > 0))
Attachments check_id_ContentId ((id <> "ContentId"))
MyGroupNewPostsNotificationTopGroups MyGroupNewPostsNotificationTopGroups_rank_check (((rank >= 1) AND (rank <= 3)))
Replies check_id (((id <> "RootContentId") AND (id <> "ParentReplyId") AND ("RootContentId" <> "ParentReplyId")))
Replies check_reply_userId (((status = 'TRASH'::gcud."enum_Contents_status") OR ("UserId" IS NOT NULL)))
Hashtags Hashtags_id_check (((btrim(id) <> ''::text) AND (lower(id) = id)))
BlockedUsers BlockedUserId_cannot_be_equal_to_BlockerUserId (("BlockedUserId" <> "BlockerUserId"))
Posts check_post_title ((((type = 'STANDARD'::gcud."enum_Posts_type") AND (title IS NULL)) OR ((type = 'QUESTION'::gcud."enum_Posts_type") AND (title IS NOT NULL))))
Posts check_post_userid (((status = 'TRASH'::gcud."enum_Contents_status") OR ("UserId" IS NOT NULL)))