Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
'use strict';
const {
Model
} = require('sequelize');
module.exports = (sequelize, DataTypes) => {
class PostTag extends Model {
/**
* Helper method for defining associations.
* This method is not a part of Sequelize lifecycle.
* The `models/index` file will call this method automatically.
*/
static associate(models) {
// define association here
}
};
PostTag.init({
post_id: DataTypes.INTEGER,
tag_id: DataTypes.INTEGER
}, {
sequelize,
modelName: 'PostTag',
});
return PostTag;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment