Appearance
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:
Field | Type | Description |
---|---|---|
id | INTEGER | unique sequence id of the user |
first_name | VARCHAR | user first name |
last_name | VARCHAR | user last name |
VARCHAR | user email name; unique constraint | |
password | VARCHAR | hashed user password |
password_reset_hash | VARCHAR | hashed user password reset token |
stripe_customer_id | VARCHAR | stripe customer id associated with user.id |
createdAt | DATE | date the record was created |
updatedAt | DATE | date the record was updated |
deletedAt | DATE | date 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.