Skip to content

membership

A user’s membership of a community; joined_at is when they joined.

Name Type Default Nullable Children Parents Comment
id bigint nextval(‘membership_seq’::regclass) false
public_id uuid gen_random_uuid() false
community_id bigint false public.community
user_id bigint false public.app_user
joined_at timestamp with time zone now() false
created_at timestamp with time zone now() false
updated_at timestamp with time zone true
Name Type Definition
fk_membership_user_id FOREIGN KEY FOREIGN KEY (user_id) REFERENCES app_user(id)
fk_membership_community_id FOREIGN KEY FOREIGN KEY (community_id) REFERENCES community(id)
membership_pkey PRIMARY KEY PRIMARY KEY (id)
uq_membership_public_id UNIQUE UNIQUE (public_id)
uq_membership_community_id_user_id UNIQUE UNIQUE (community_id, user_id)
Name Definition
membership_pkey CREATE UNIQUE INDEX membership_pkey ON public.membership USING btree (id)
uq_membership_public_id CREATE UNIQUE INDEX uq_membership_public_id ON public.membership USING btree (public_id)
uq_membership_community_id_user_id CREATE UNIQUE INDEX uq_membership_community_id_user_id ON public.membership USING btree (community_id, user_id)
ix_membership_user_id CREATE INDEX ix_membership_user_id ON public.membership USING btree (user_id)

ER diagram


Generated by tbls