public.comments

October 18, 2025 ยท View on GitHub

Description

Comments
Multi-line
table
comment

Columns

NameTypeDefaultNullableExtra DefinitionChildrenParentsComment
idbigintnextval('comments_id_seq'::regclass)falsepublic.logs
post_idbigintfalsepublic.comment_starspublic.posts
user_idintegerfalsepublic.comment_starspublic.users
commenttextfalseComment
Multi-line
column
comment
post_id_descbiginttrueGENERATED ALWAYS AS (post_id * '-1'::integer) STORED
createdtimestamp without time zonefalse
updatedtimestamp without time zonetrue

Constraints

NameTypeDefinition
comments_user_id_fkFOREIGN KEYFOREIGN KEY (user_id) REFERENCES users(id)
comments_post_id_fkFOREIGN KEYFOREIGN KEY (post_id) REFERENCES posts(id)
comments_id_pkPRIMARY KEYPRIMARY KEY (id)
comments_post_id_user_id_keyUNIQUEUNIQUE (post_id, user_id)

Indexes

NameDefinition
comments_id_pkCREATE UNIQUE INDEX comments_id_pk ON public.comments USING btree (id)
comments_post_id_user_id_keyCREATE UNIQUE INDEX comments_post_id_user_id_key ON public.comments USING btree (post_id, user_id)
comments_post_id_user_id_idxCREATE INDEX comments_post_id_user_id_idx ON public.comments USING btree (post_id, user_id)

Relations

er


Generated by tbls