A set of users with a shared match history. Soft-deleted. Invariants (application): the admin group, if set, is owned by the community’s owner and is cleared when ownership is transferred; only the owner may remove an admin, any admin may remove a non-admin member; an admin who leaves or is removed is also removed from the admin group.
| Name |
Type |
Default |
Nullable |
Children |
Parents |
Comment |
| id |
bigint |
nextval(‘community_seq’::regclass) |
false |
public.membership public.membership_request public.match |
|
|
| public_id |
uuid |
gen_random_uuid() |
false |
|
|
|
| owner_user_id |
bigint |
|
false |
|
public.app_user |
|
| admin_group_id |
bigint |
|
true |
|
public.app_group |
|
| display_name |
varchar(100) |
|
false |
|
|
|
| description |
text |
|
true |
|
|
|
| join_policy |
varchar(20) |
‘OPEN’::character varying |
false |
|
|
|
| created_at |
timestamp with time zone |
now() |
false |
|
|
|
| updated_at |
timestamp with time zone |
|
true |
|
|
|
| deleted_at |
timestamp with time zone |
|
true |
|
|
|
| version |
bigint |
|
false |
|
|
|
| Name |
Type |
Definition |
| chk_community_join_policy |
CHECK |
CHECK (((join_policy)::text = ANY ((ARRAY[‘OPEN’::character varying, ‘REQUIRES_APPROVAL’::character varying])::text[]))) |
| fk_community_owner_user_id |
FOREIGN KEY |
FOREIGN KEY (owner_user_id) REFERENCES app_user(id) |
| fk_community_admin_group_id |
FOREIGN KEY |
FOREIGN KEY (admin_group_id) REFERENCES app_group(id) |
| community_pkey |
PRIMARY KEY |
PRIMARY KEY (id) |
| uq_community_public_id |
UNIQUE |
UNIQUE (public_id) |
| Name |
Definition |
| community_pkey |
CREATE UNIQUE INDEX community_pkey ON public.community USING btree (id) |
| uq_community_public_id |
CREATE UNIQUE INDEX uq_community_public_id ON public.community USING btree (public_id) |
| ix_community_owner_user_id |
CREATE INDEX ix_community_owner_user_id ON public.community USING btree (owner_user_id) |
| ix_community_admin_group_id |
CREATE INDEX ix_community_admin_group_id ON public.community USING btree (admin_group_id) |

Generated by tbls