Video Thumbnail

Sign up for a plan to instantly unlock all premium lessons.

Premium Features

Download Video

16. Password Reset Functionality - Part 2

Published 2 years ago

Migration File
module.exports = {
  up: (queryInterface, Sequelize) => {
    return Promise.all([
      queryInterface.addColumn(
        'Users', // name of database table
        'resetPasswordToken', // name of the key we're adding
        {
          type: Sequelize.STRING
        }
      ),
      queryInterface.addColumn(
        'Users', // name of database table
        'resetPasswordTokenExpiration', // name of the key we're adding
        {
          type: Sequelize.DATE
        }
      )
    ]).catch(() => undefined)
  },

  down: (queryInterface, Sequelize) => {
    return Promise.all([
      queryInterface.removeColumn(
        'Users', // name of database table
        'resetPasswordToken' // key we want to remove
      ),
      queryInterface.removeColumn(
        'Users', // name of database table
        'resetPasswordTokenExpiration' // key we want to remove
      )
    ]).catch(() => undefined)
  }
}

Comments

Want to participate?

Create a free Chris Courses account to begin

Login

No comments yet, be the first to add one

Cheat Sheet Preview

Download The Official Chris Courses HTML5 Canvas Cheat Sheet

Essential canvas syntax at your fingertips.

Download Now

Providing the lift to launch your development career

© 2021 Chris Courses. All rights reserved.