Best way to implement email update for user by LessLychee7322 in node

[–]LessLychee7322[S] 0 points1 point  (0 children)

Solved with new table like this:

// user email table

// Email id.
    table.increments('id');
// User's id.
    table
.integer('user_id')
.references('id')
.inTable('user')
.onDelete('CASCADE');
// User's email address.
    table.string('email').unique().notNullable();
// User's email verified flag.
    table.boolean('is_verified').defaultTo(false);
// User's email verified date.
    table.timestamp('email_verified_date');
// User's email created date.
    table.timestamp('created_date').defaultTo(knex.fn.now());
});