fix migration

This commit is contained in:
les
2020-03-14 20:09:16 +01:00
parent 4f3448332b
commit 7dd1f76ccf
2 changed files with 1 additions and 20 deletions

View File

@@ -1,19 +0,0 @@
const { event: Event } = require('../api/models')
module.exports = {
up: async (queryInterface, Sequelize) => {
const events = await Event.findAll({})
const promises = events.map(e => {
return e.update({ recurrent: JSON.parse(e.recurrent) })
})
return Promise.all(promises)
},
down: async (queryInterface, Sequelize) => {
const events = await Event.findAll({})
const promises = events.map(e => {
return e.update({ recurrent: JSON.stringify(e.recurrent) })
})
return Promise.all(promises)
}
}