File: /var/www/javago-api-updates/src/models/CafeManagement.model.js
import Sequelize from "sequelize";
import sequelize from "../config/database.config.js";
import sequelizePaginate from "sequelize-paginate";
const CafeManagement = sequelize.define(
"cafe_management",
{
id: {
type: Sequelize.INTEGER,
primaryKey: true,
autoIncrement: true,
allowNull: false,
},
cafe_id: {
type: Sequelize.BIGINT,
allowNull: false,
},
coffee_origin: {
type: Sequelize.STRING,
allowNull: true,
},
coffee_roast: {
type: Sequelize.STRING,
allowNull: true,
},
coffee_origin_country: {
type: Sequelize.STRING,
allowNull: true,
},
speciallity_coffee: {
type: Sequelize.TINYINT(1),
defaultValue: 1,
comment: "0=no,1=yes",
},
click_and_collect: {
type: Sequelize.TINYINT(1),
defaultValue: 1,
comment: "0=no,1=yes",
},
max_orders_click_collect: {
type: Sequelize.INTEGER,
allowNull: true,
},
created_at: {
type: Sequelize.INTEGER(10),
defaultValue: 0,
},
updated_at: {
type: Sequelize.INTEGER(10),
defaultValue: 0,
},
},
{
tableName: "cafe_management",
timestamps: false,
}
);
sequelizePaginate.paginate(CafeManagement);
CafeManagement.sync();
export default CafeManagement;