41 lines
773 B
JavaScript
41 lines
773 B
JavaScript
const { DataTypes, Model } = require('sequelize')
|
|
const sequelize = require('../../config/sequelize.conf')
|
|
const Status = require('./Status')
|
|
|
|
class Salon extends Model {}
|
|
Salon.init(
|
|
{
|
|
idSalon: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
allowNull: false,
|
|
autoIncrement: true,
|
|
unique: true,
|
|
},
|
|
salon: {
|
|
type: DataTypes.STRING(50),
|
|
allowNull: false,
|
|
},
|
|
activo: {
|
|
type: DataTypes.BOOLEAN,
|
|
defaultValue: false,
|
|
},
|
|
idStatus: {
|
|
type: DataTypes.INTEGER,
|
|
references: {
|
|
model: Status,
|
|
key: 'idStatus',
|
|
},
|
|
allowNull: false,
|
|
},
|
|
},
|
|
{
|
|
sequelize,
|
|
modelName: 'Salon',
|
|
tableName: 'salon',
|
|
timestamps: false,
|
|
}
|
|
)
|
|
|
|
module.exports = Salon
|