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,6 +1,6 @@
{ {
"name": "gancio", "name": "gancio",
"version": "0.21.0", "version": "0.22.1",
"description": "A shared agenda for local communities", "description": "A shared agenda for local communities",
"author": "lesion", "author": "lesion",
"scripts": { "scripts": {

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)
}
}