users table

The users table in the Social Media Database Schema schema has 9 columns, keyed by id, with 1 foreign key to profiles. 34 columns in sessions, follows, blocks, mutes and 23 more reference it.

Handle and credentials only. Everything a visitor sees lives in profiles, so a rename never touches the auth row.

Columns (9)

Columns of the users table
ColumnTypeConstraintsDescription
iduuidprimary key, references profiles.user_id
usernamevarchar(30)unique, not null
emailvarchar(255)unique, not null
phonevarchar(32)unique
is_verifiedbooleannot null
is_privatebooleannot null
statusaccount_statusnot null
created_attimestamptznot null
deactivated_attimestamptz

Indexes (1)

  • (status, created_at)

Relationships