flame/models/Category.js

32 lines
567 B
JavaScript
Raw Normal View History

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,
},
orderId: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: null,
},
isPublic: {
type: DataTypes.INTEGER,
allowNull: true,
defaultValue: 1,
},
2021-05-22 17:04:34 +00:00
},
{
tableName: 'categories',
2021-05-22 17:04:34 +00:00
}
);
2021-05-22 17:04:34 +00:00
module.exports = Category;