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