mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 09:02:01 +01:00
19 lines
546 B
JavaScript
19 lines
546 B
JavaScript
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)
|
|
}
|
|
}
|