cnc-speed-calculator/sequelize/models/user.model.js

26 lines
620 B
JavaScript
Raw Permalink Normal View History

2021-01-28 01:30:55 +01:00
const { DataTypes } = require('sequelize');
module.exports = (sequelize) => {
sequelize.define('user', {
id: {
allowNull: false,
autoIncrement: true,
primaryKey: true,
type: DataTypes.INTEGER
},
username: {
allowNull: false,
type: DataTypes.STRING,
unique: true
},
password: {
allowNull: false,
type: DataTypes.STRING,
2021-01-30 20:33:06 +01:00
},
is_admin: {
allowNull: false,
defaultValue: false,
type: DataTypes.BOOLEAN
2021-01-28 01:30:55 +01:00
}
})
}