32 lines
624 B
JavaScript
32 lines
624 B
JavaScript
const { DataTypes, Model } = require('sequelize');
|
|
const sequelize = require('../../config/sequelize.conf');
|
|
|
|
class Infraccion extends Model {}
|
|
Infraccion.init(
|
|
{
|
|
idInfraccion: {
|
|
type: DataTypes.INTEGER,
|
|
primaryKey: true,
|
|
allowNull: false,
|
|
unique: true,
|
|
autoIncrement: true,
|
|
},
|
|
infraccion: {
|
|
type: DataTypes.STRING(100),
|
|
allowNull: false,
|
|
},
|
|
gravedad: {
|
|
type: DataTypes.STRING(1),
|
|
allowNull: false,
|
|
},
|
|
},
|
|
{
|
|
sequelize,
|
|
modelName: 'Infraccion',
|
|
tableName: 'infraccion',
|
|
timestamps: false,
|
|
}
|
|
);
|
|
|
|
module.exports = Infraccion;
|