2023-11-09 16:57:00 +01:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
/** @type {import('sequelize-cli').Migration} */
|
|
|
|
module.exports = {
|
|
|
|
async up (queryInterface, Sequelize) {
|
|
|
|
/**
|
|
|
|
* Add altering commands here.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* await queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
|
|
|
*/
|
|
|
|
return Promise.all(
|
|
|
|
[
|
|
|
|
await queryInterface.addColumn('ap_users', 'following', { type: Sequelize.BOOLEAN }),
|
2023-11-20 23:15:28 +01:00
|
|
|
await queryInterface.addColumn('ap_users', 'friendly', { type: Sequelize.BOOLEAN }),
|
2023-11-21 22:11:32 +01:00
|
|
|
await queryInterface.addColumn('filters', 'actors', { type: Sequelize.JSON }),
|
2023-11-30 15:24:20 +01:00
|
|
|
await queryInterface.addColumn('events', 'ap_id', { type: Sequelize.STRING }),
|
2023-11-09 16:57:00 +01:00
|
|
|
await queryInterface.addColumn('events', 'apUserApId', {
|
|
|
|
type: Sequelize.STRING,
|
|
|
|
references: {
|
|
|
|
model: 'ap_users',
|
|
|
|
key: 'ap_id'
|
|
|
|
},
|
|
|
|
onUpdate: 'CASCADE',
|
|
|
|
onDelete: 'CASCADE'
|
|
|
|
}),
|
|
|
|
// apUserApId
|
|
|
|
])
|
|
|
|
},
|
|
|
|
|
|
|
|
async down (queryInterface, Sequelize) {
|
|
|
|
/**
|
|
|
|
* Add reverting commands here.
|
|
|
|
*
|
|
|
|
* Example:
|
|
|
|
* await queryInterface.dropTable('users');
|
|
|
|
*/
|
|
|
|
return Promise.all(
|
|
|
|
[
|
2023-11-20 23:15:28 +01:00
|
|
|
await queryInterface.removeColumn('events', 'apUserApId'),
|
2023-11-09 16:57:00 +01:00
|
|
|
await queryInterface.removeColumn('ap_users', 'following'),
|
2023-11-20 23:15:28 +01:00
|
|
|
await queryInterface.removeColumn('ap_users', 'friendly'),
|
2023-11-09 16:57:00 +01:00
|
|
|
])
|
|
|
|
}
|
|
|
|
};
|