Users table

The Users table in the FitStack - V2 schema has 37 columns, keyed by Id, with 1 foreign key to StreamlabsConnections. 120 columns in GymEquipmentReports, UserHealthProfiles, UserSettings, UserRoles and 98 more reference it.

Does NOT inherit `Auditable` — it hand-rolls `IsDeleted` and `CreatedAt` and has no `ModifiedAt`/`DeletedAt`. Consequence: **no global soft-delete query filter applies to Users.** Deleted users are returned by every query unless the caller filters explicitly.

Columns (37)

Columns of the Users table
ColumnTypeConstraintsDescription
Idtextprimary key, not null, references StreamlabsConnections.UserIdIdentityUser string key. Every *UserId in the schema points here.
UserNamecharacter varying(256)
NormalizedUserNamecharacter varying(256)
Emailcharacter varying(256)
NormalizedEmailcharacter varying(256)
EmailConfirmedbooleannot null
PasswordHashtext
SecurityStamptext
ConcurrencyStamptext
PhoneNumbertext
PhoneNumberConfirmedbooleannot null
TwoFactorEnabledbooleannot null
LockoutEndtimestamp with time zone
LockoutEnabledbooleannot null
AccessFailedCountintegernot null
UserTypesinteger[]not null`UserType` enum ordinals. A user holds MANY types; roles are seeded from this enum.
RegistrationStatusintegernot null`RegistrationStatus` enum, stored as int.
HealthProfileIduuidnot nullINVERTED 1:1 — the FK lives on Users, not on the profile.
SettingsIduuidnot nullINVERTED 1:1 — FK on Users.
ProfileIduuidVestigial. The real FK is UserProfiles.UserId. Candidate for removal.
StripeAccountIdtext
StripeConnectedAccountIdtext
StripeChargesEnabledbooleannot null
StripePayoutsEnabledbooleannot null
StripeDetailsSubmittedbooleannot null
StripeRequirementsJsontext
StripeOnboardedAttimestamp with time zone
FcmtextFirebase push token, mobile.
WebFcmtextFirebase push token, web.
Tiercharacter varying(32)not null`SubscriptionTier` stored as TEXT.
PremiumExpiresAttimestamp with time zone
PremiumSourcecharacter varying(32)not null`PremiumSource` stored as TEXT.
PayRatenumeric(10,2)not nullAnnotator pay rate.
AnnotationTargetintegernot null
IsActivebooleannot null
IsDeletedbooleannot null
CreatedAttimestamp with time zonenot null

Indexes (5)

  • (Email) (IX_Users_Email)
  • (NormalizedEmail) (EmailIndex)
  • (NormalizedUserName) unique (UserNameIndex)
  • (HealthProfileId) unique (IX_Users_HealthProfileId)
  • (SettingsId) unique (IX_Users_SettingsId)

Relationships