app2-api/modules/blog/post-category.model.js

25 lines
481 B
JavaScript
Raw Normal View History

2019-04-15 15:58:58 +00:00
module.exports = function (sequelize, DataTypes) {
2022-02-18 19:32:30 +00:00
const PostCategory = sequelize.define(
"PostCategory",
{
postId: {
type: DataTypes.UUID,
primaryKey: true,
foreignKey: true,
},
categoryId: {
type: DataTypes.INTEGER,
primaryKey: true,
foreignKey: true,
},
},
{
tableName: "posts_categories",
freezeTableName: true,
timestamps: false,
}
);
2019-04-15 15:58:58 +00:00
2022-02-18 19:32:30 +00:00
return PostCategory;
};