Skip to content

User Schema

Most applications require some form of a user database model. Since this is such common practice and something developers have to repeat from one project to the next, StarterStack includes this out-of-the-box (along with the apis and UIs).

The User Table

The database schema has a basic user table to get you started. The table is structured as follows:

FieldTypeDescription
idINTEGERunique sequence id of the user
first_nameVARCHARuser first name
last_nameVARCHARuser last name
emailVARCHARuser email name; unique constraint
passwordVARCHARhashed user password
password_reset_hashVARCHARhashed user password reset token
stripe_customer_idVARCHARstripe customer id associated with user.id
createdAtDATEdate the record was created
updatedAtDATEdate the record was updated
deletedAtDATEdate the record was deleted

NOTE

StarterStack uses the Sequelize soft delete feature. Records don't actually get deleted. They are marked with a deletedAt date and consequently excluded from queries. This affords you the opportunity to resurrect those records if needed.