Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const sequelize = require('../dbConnection.js')
- const Sequelize = require('sequelize')
- const user = sequelize.define('user', {
- user_id: {
- type: Sequelize.INTEGER(11),
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- user_name: {
- type: Sequelize.STRING(100),
- allowNull: false,
- unique: true
- },
- password: {
- type: Sequelize.STRING(100),
- allowNull: true
- },
- access_token: {
- type: Sequelize.STRING(1000),
- allowNull: true
- },
- expiration_date: {
- type: Sequelize.DATEONLY,
- allowNull: true
- },
- profile_id: {
- type: Sequelize.INTEGER(11),
- allowNull: false,
- references: {
- model: 'profile',
- key: 'profile_id'
- }
- }
- }, {
- freezeTableName: true,
- timestamps: false,
- tableName: 'user'
- })
- module.exports = user
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement