2
0
mirror of https://github.com/status-im/codimd.git synced 2025-01-20 19:18:59 +00:00
codimd/lib/migrations/20160607060246-support-revision.js

28 lines
678 B
JavaScript
Raw Normal View History

'use strict';
module.exports = {
up: function (queryInterface, Sequelize) {
queryInterface.addColumn('Notes', 'savedAt', Sequelize.DATE);
queryInterface.createTable('Revisions', {
id: {
type: Sequelize.UUID,
primaryKey: true
},
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;
}
};