gancio-upstream/server/migrations/20231110214302-federation.js

40 lines
1.3 KiB
JavaScript
Raw Normal View History

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-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-22 09:29:20 +01:00
apUserApId
2023-11-09 16:57:00 +01:00
])
},
async down (queryInterface, Sequelize) {
return Promise.all(
[
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-11-20 23:15:28 +01:00
await queryInterface.removeColumn('ap_users', 'friendly'),
2023-11-09 16:57:00 +01:00
])
}
};