diff options
Diffstat (limited to 'lib/migrations')
-rw-r--r-- | lib/migrations/20160607060246-support-revision.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/migrations/20160607060246-support-revision.js b/lib/migrations/20160607060246-support-revision.js new file mode 100644 index 00000000..9721d7fc --- /dev/null +++ b/lib/migrations/20160607060246-support-revision.js @@ -0,0 +1,24 @@ +'use strict'; + +module.exports = { + up: function (queryInterface, Sequelize) { + queryInterface.addColumn('Notes', 'savedAt', Sequelize.DATE); + queryInterface.createTable('Revisions', { + id: Sequelize.UUID, + noteId: Sequelize.UUID, + patch: Sequelize.TEXT, + lastContent: Sequelize.TEXT, + content: Sequelize.TEXT, + length: Sequelize.INTEGER, + createdAt: Sequelize.DATE, + updatedAt: Sequelize.DATE + }); + return; + }, + + down: function (queryInterface, Sequelize) { + queryInterface.dropTable('Revisions'); + queryInterface.removeColumn('Notes', 'savedAt'); + return; + } +}; |