mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
minor: refactoring AP migration
This commit is contained in:
parent
1adaa95817
commit
207b063534
2 changed files with 6 additions and 5 deletions
|
@ -7,7 +7,7 @@ module.exports = (sequelize, DataTypes) =>
|
||||||
},
|
},
|
||||||
follower: DataTypes.BOOLEAN,
|
follower: DataTypes.BOOLEAN,
|
||||||
following: DataTypes.BOOLEAN,
|
following: DataTypes.BOOLEAN,
|
||||||
friendly: DataTypes.BOOLEAN,
|
trusted: DataTypes.BOOLEAN,
|
||||||
blocked: DataTypes.BOOLEAN,
|
blocked: DataTypes.BOOLEAN,
|
||||||
object: {
|
object: {
|
||||||
type: DataTypes.JSON,
|
type: DataTypes.JSON,
|
||||||
|
|
|
@ -11,8 +11,9 @@ module.exports = {
|
||||||
*/
|
*/
|
||||||
return Promise.all(
|
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', 'following', { type: Sequelize.BOOLEAN }),
|
||||||
await queryInterface.addColumn('ap_users', 'friendly', { type: Sequelize.BOOLEAN }),
|
|
||||||
await queryInterface.addColumn('filters', 'actors', { type: Sequelize.JSON }),
|
await queryInterface.addColumn('filters', 'actors', { type: Sequelize.JSON }),
|
||||||
await queryInterface.addColumn('events', 'ap_id', { type: Sequelize.STRING, index: true }),
|
await queryInterface.addColumn('events', 'ap_id', { type: Sequelize.STRING, index: true }),
|
||||||
await queryInterface.addColumn('events', 'apUserApId', {
|
await queryInterface.addColumn('events', 'apUserApId', {
|
||||||
|
@ -24,17 +25,17 @@ module.exports = {
|
||||||
onUpdate: 'CASCADE',
|
onUpdate: 'CASCADE',
|
||||||
onDelete: 'CASCADE'
|
onDelete: 'CASCADE'
|
||||||
}),
|
}),
|
||||||
apUserApId
|
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
|
|
||||||
async down (queryInterface, Sequelize) {
|
async down (queryInterface, Sequelize) {
|
||||||
return Promise.all(
|
return Promise.all(
|
||||||
[
|
[
|
||||||
|
await queryInterface.removeColumn('instances', 'applicationActor'),
|
||||||
await queryInterface.removeColumn('events', 'apUserApId'),
|
await queryInterface.removeColumn('events', 'apUserApId'),
|
||||||
await queryInterface.removeColumn('events', 'ap_id'),
|
await queryInterface.removeColumn('events', 'ap_id'),
|
||||||
await queryInterface.removeColumn('ap_users', 'following'),
|
await queryInterface.removeColumn('ap_users', 'following'),
|
||||||
await queryInterface.removeColumn('ap_users', 'friendly'),
|
await queryInterface.removeColumn('ap_users', 'trusted'),
|
||||||
])
|
])
|
||||||
}
|
}
|
||||||
};
|
};
|
Loading…
Reference in a new issue