Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 'use strict'
- // See http://docs.sequelizejs.com/en/latest/docs/models-definition/
- // for more of what you can do here.
- const Sequelize = require('sequelize');
- module.exports = function (app) {
- const sequelizeClient = app.get('sequelizeClient');
- const users = sequelizeClient.define('users', {
- username: {
- type: Sequelize.STRING,
- allowNull: true,
- unique: true
- },
- email: {
- type: Sequelize.STRING,
- allowNull: true,
- unique: true
- },
- password: {
- type: Sequelize.STRING,
- allowNull: true
- },
- });
- users.associate = (models) => {
- users.hasMany(models.auctions, { foreignKey: 'seller_id' })
- }
- return users;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement