refactoring media in event (multiple in db, focalpoint, alt text)
This commit is contained in:
25
server/migrations/20210705183419-add_event_media.js
Normal file
25
server/migrations/20210705183419-add_event_media.js
Normal file
@@ -0,0 +1,25 @@
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
return Promise.all(
|
||||
[
|
||||
await queryInterface.addColumn('events', 'media', { type: Sequelize.JSON }),
|
||||
await queryInterface.sequelize.query("UPDATE events set media=JSON('[{ \"url\": \"' || image_path || '\" }]')")
|
||||
])
|
||||
/**
|
||||
* Add altering commands here.
|
||||
*
|
||||
* Example:
|
||||
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
/**
|
||||
* Add reverting commands here.
|
||||
*
|
||||
* Example:
|
||||
* await queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user