Fixed revisions table losing originalIndex when article was deleted

I've also included a migration file in the tools directory
This commit is contained in:
2021-11-17 06:16:33 +00:00
parent c30cf80fc6
commit 3bb0b2aa29
4 changed files with 14 additions and 5 deletions
+5 -2
View File
@@ -17,12 +17,15 @@ const revisions = sequelize.define('revisions', {
body: {
type: Sequelize.TEXT,
defaultValue: ''
},
originalIndex: {
type: Sequelize.INTEGER(11),
default: null
}
});
//relationships
articles.hasOne(revisions, { as: 'original' });
sequelize.sync();
module.exports = revisions;