Commit 7dd1f76c authored by les's avatar les
Browse files

fix migration

parent 4f344833
{ {
"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": {
......
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)
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment