January 2019
Intermediate to advanced
520 pages
14h 32m
English
Add the following statement to the up.sql script:
CREATE TABLE users ( id SERIAL PRIMARY KEY, email TEXT NOT NULL UNIQUE);
As you can see, the table has two columns. id represents the unique ID of the user, and we will use this identifier in other tables later. The email column contains the unique e-mail of the user. For real applications, the users table also has to contain a hashed password, and two columns to store when the user was created and updated.
Read now
Unlock full access