minor: refactoring AP migration

This commit is contained in:
lesion 2023-12-26 13:01:22 +01:00
parent 1adaa95817
commit 207b063534
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 6 additions and 5 deletions

View file

@ -7,7 +7,7 @@ module.exports = (sequelize, DataTypes) =>
},
follower: DataTypes.BOOLEAN,
following: DataTypes.BOOLEAN,
friendly: DataTypes.BOOLEAN,
trusted: DataTypes.BOOLEAN,
blocked: DataTypes.BOOLEAN,
object: {
type: DataTypes.JSON,

View file

@ -11,8 +11,9 @@ module.exports = {
*/
return Promise.all(
[
await queryInterface.addColumn('ap_users', 'trusted', { type: Sequelize.BOOLEAN }),
await queryInterface.addColumn('instances', 'applicationActor', { type: Sequelize.STRING }),
await queryInterface.addColumn('ap_users', 'following', { type: Sequelize.BOOLEAN }),
await queryInterface.addColumn('ap_users', 'friendly', { type: Sequelize.BOOLEAN }),
await queryInterface.addColumn('filters', 'actors', { type: Sequelize.JSON }),
await queryInterface.addColumn('events', 'ap_id', { type: Sequelize.STRING, index: true }),
await queryInterface.addColumn('events', 'apUserApId', {
@ -24,17 +25,17 @@ module.exports = {
onUpdate: 'CASCADE',
onDelete: 'CASCADE'
}),
apUserApId
])
},
async down (queryInterface, Sequelize) {
return Promise.all(
[
await queryInterface.removeColumn('instances', 'applicationActor'),
await queryInterface.removeColumn('events', 'apUserApId'),
await queryInterface.removeColumn('events', 'ap_id'),
await queryInterface.removeColumn('ap_users', 'following'),
await queryInterface.removeColumn('ap_users', 'friendly'),
await queryInterface.removeColumn('ap_users', 'trusted'),
])
}
};