Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Sequelize = require("sequelize");
- const db = require("../Connection/dbConnection");
- const UserType = require('../models/userTypeModel')
- const User = db.define("user", {
- id: {
- type: DataTypes.INTEGER(11),
- allowNull: false,
- primaryKey: true,
- autoIncrement: true
- },
- userName: {
- type: DataTypes.STRING(512),
- allowNull: true
- },
- password: {
- type: DataTypes.STRING(512),
- allowNull: true
- },
- userTypeId: {
- type: DataTypes.INTEGER(11),
- allowNull: true
- },
- isActive: {
- type: DataTypes.INTEGER(1),
- allowNull: true,
- defaultValue: "1"
- }}
- ,
- {
- timestamps: false
- }
- );
- User.belongsTo(UserType,{as:'UserType',foreignKey:'userTypeId'})
- module.exports = User;
Add Comment
Please, Sign In to add comment