Advertisement
AyaMagdy

user

Jan 14th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const sequelize = require('../dbConnection.js')
  2. const Sequelize = require('sequelize')
  3. const user = sequelize.define('user', {
  4.   user_id: {
  5.     type: Sequelize.INTEGER(11),
  6.     allowNull: false,
  7.     primaryKey: true,
  8.     autoIncrement: true
  9.   },
  10.   user_name: {
  11.     type: Sequelize.STRING(100),
  12.     allowNull: false,
  13.     unique: true
  14.   },
  15.   password: {
  16.     type: Sequelize.STRING(100),
  17.     allowNull: true
  18.   },
  19.   access_token: {
  20.     type: Sequelize.STRING(1000),
  21.     allowNull: true
  22.   },
  23.   expiration_date: {
  24.     type: Sequelize.DATEONLY,
  25.     allowNull: true
  26.   },
  27.   profile_id: {
  28.     type: Sequelize.INTEGER(11),
  29.     allowNull: false,
  30.     references: {
  31.       model: 'profile',
  32.       key: 'profile_id'
  33.     }
  34.   }
  35. }, {
  36.   freezeTableName: true,
  37.   timestamps: false,
  38.   tableName: 'user'
  39. })
  40.  
  41. module.exports = user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement