UserProfiles table

The UserProfiles table in the FitStack - V2 schema has 22 columns, keyed by Id, with 2 foreign keys to Media. 1 column in Users references it.

The five inline `*Url` columns duplicate what SocialTags models properly. v2 should pick one; keeping both guarantees they disagree.

Columns (22)

Columns of the UserProfiles table
ColumnTypeConstraintsDescription
Iduuidprimary key, not null
UserIdtextnot null1:1, CASCADE. Principal side is Users.
Biotextnot null
IsPublicbooleannot null
IsVerifiedbooleannot null
FollowersCountintegernot nullDenormalised counter — must be recomputed if Followings is edited directly.
FollowingCountintegernot nullDenormalised counter.
PostsCountintegernot nullDenormalised counter.
ProfilePictureIduuidreferences Media.Id
CoverPhotoIduuidreferences Media.Id
FirstNametext
LastNametext
DisplayNametext
WebsiteUrltext
YoutubeUrltext
InstagramUrltext
TwitterUrltext
TikTokUrltext
CreatedAttimestamp with time zonenot null
ModifiedAttimestamp with time zone
IsDeletedbooleannot null
DeletedAttimestamp with time zone

Indexes (3)

  • (ProfilePictureId) (IX_UserProfiles_ProfilePictureId)
  • (CoverPhotoId) (IX_UserProfiles_CoverPhotoId)
  • (DisplayName) (IX_UserProfiles_DisplayName_trgm)

Relationships

  • UserProfiles.ProfilePictureId references Media.Id
  • UserProfiles.CoverPhotoId references Media.Id
  • Users.Id references UserProfiles