group_members table

The group_members table in the Social Media Database Schema schema has 4 columns, with 2 foreign keys to groups and users.

Posts carry a nullable group_id, so one posts table serves both the public timeline and every group.

Columns (4)

Columns of the group_members table
ColumnTypeConstraintsDescription
group_iduuidnot null, references groups.id
user_iduuidnot null, references users.id
rolegroup_rolenot null
joined_attimestamptznot null

Indexes (1)

  • (user_id)

Relationships

  • group_members.group_id references groups.id
  • group_members.user_id references users.id