2021-05-22 17:04:34 +00:00
|
|
|
const { DataTypes } = require('sequelize');
|
|
|
|
const { sequelize } = require('../db');
|
|
|
|
|
|
|
|
const Category = sequelize.define('Category', {
|
|
|
|
name: {
|
|
|
|
type: DataTypes.STRING,
|
|
|
|
allowNull: false
|
|
|
|
},
|
|
|
|
isPinned: {
|
|
|
|
type: DataTypes.BOOLEAN,
|
|
|
|
defaultValue: false
|
2021-06-18 08:38:05 +00:00
|
|
|
},
|
|
|
|
orderId: {
|
|
|
|
type: DataTypes.INTEGER,
|
|
|
|
allowNull: true,
|
|
|
|
defaultValue: null
|
2021-05-22 17:04:34 +00:00
|
|
|
}
|
|
|
|
}, {
|
|
|
|
tableName: 'categories'
|
|
|
|
});
|
|
|
|
|
|
|
|
module.exports = Category;
|