Write user migration

Initialize migration file

npm run migrate create add-user-table

Write UP migration implementation

pgm.createTable('users', {
  user_id: {
    type: 'serial',
    primaryKey: true,
  },
  name: {
    type: 'varchar(255)',
    notNull: true,
  },
  email: {
    type: 'varchar(255)',
    notNull: true,
    unique: true,
  },
  password_hash: {
    type: 'text',
    notNull: true,
  },
  created_at: {
    type: 'timestamp',
    notNull: true,
    default: pgm.func('current_timestamp'),
  },
});

Write DOWN Migration implementation

pgm.dropTable('users');

Run the migration

npm run migrate up

Commit

git add .
git commit -m 'Adds session and user migrations'

Next:
Write user model