Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 'use strict';
  2.  
  3. module.exports = {
  4.   up: (queryInterface, Sequelize) => {
  5.     return queryInterface.createTable('users', {
  6.       id: {
  7.         type: Sequelize.INTEGER,
  8.         allowNull: false,
  9.         autoIncrement: true,
  10.         primaryKey: true
  11.       },
  12.       name: {
  13.         type: Sequelize.STRING,
  14.         allowNull: false
  15.       },
  16.       email: {
  17.         type: Sequelize.STRING,
  18.         allowNull: false,
  19.         unique: true
  20.       },
  21.       password_hash: {
  22.         type: Sequelize.STRING,
  23.         allowNull: false
  24.       },
  25.       provider: {
  26.         type: Sequelize.BOOLEAN,
  27.         defaultValue: false,
  28.         allowNull: false
  29.       },
  30.       created_at: {
  31.         type: Sequelize.DATE,
  32.         allowNull: false
  33.       },
  34.       updated_at: {
  35.         type: Sequelize.DATE,
  36.         allowNull: false
  37.       }
  38.     });
  39.   },
  40.  
  41.   down: queryInterface => {
  42.     return queryInterface.dropTable('users');
  43.   }
  44. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement