groups table
The groups table in the Social Media Database Schema schema has 8 columns, keyed by id, with 1 foreign key to users. 2 columns in posts and group_members reference it.
Columns (8)
| Column | Type | Constraints | Description |
|---|---|---|---|
| id | uuid | primary key | |
| name | varchar(120) | not null | |
| slug | varchar(140) | unique, not null | |
| description | varchar(1000) | ||
| privacy | group_privacy | not null | |
| owner_id | uuid | not null, references users.id | |
| member_count | integer | not null | |
| created_at | timestamptz | not null |
Indexes (1)
(privacy, member_count)
Relationships
groups.owner_idreferencesusers.idposts.group_idreferencesgroupsgroup_members.group_idreferencesgroups