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(
|
|
|
|
[
|
2023-12-26 13:01:22 +01:00
|
|
|
await queryInterface.addColumn('ap_users', 'trusted', { type: Sequelize.BOOLEAN }),
|
|
|
|
await queryInterface.addColumn('instances', 'applicationActor', { type: Sequelize.STRING }),
|
2023-11-09 16:57:00 +01:00
|
|
|
await queryInterface.addColumn('ap_users', 'following', { type: Sequelize.BOOLEAN }),
|
2023-11-21 22:11:32 +01:00
|
|
|
await queryInterface.addColumn('filters', 'actors', { type: Sequelize.JSON }),
|
2023-12-22 09:29:20 +01:00
|
|
|
await queryInterface.addColumn('events', 'ap_id', { type: Sequelize.STRING, index: true }),
|
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'
|
|
|
|
}),
|
2023-12-26 13:01:22 +01:00
|
|
|
])
|
2023-11-09 16:57:00 +01:00
|
|
|
},
|
|
|
|
|
|
|
|
async down (queryInterface, Sequelize) {
|
|
|
|
return Promise.all(
|
|
|
|
[
|
2023-12-26 13:01:22 +01:00
|
|
|
await queryInterface.removeColumn('instances', 'applicationActor'),
|
2023-11-20 23:15:28 +01:00
|
|
|
await queryInterface.removeColumn('events', 'apUserApId'),
|
2023-12-22 09:29:20 +01:00
|
|
|
await queryInterface.removeColumn('events', 'ap_id'),
|
2023-11-09 16:57:00 +01:00
|
|
|
await queryInterface.removeColumn('ap_users', 'following'),
|
2023-12-26 13:01:22 +01:00
|
|
|
await queryInterface.removeColumn('ap_users', 'trusted'),
|
2023-11-09 16:57:00 +01:00
|
|
|
])
|
|
|
|
}
|
|
|
|
};
|