Created
July 29, 2020 02:26
-
-
Save derduskenga/d16db5b0cc7f041172ba128da4ebb4c0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'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