mirror of
https://framagit.org/les/gancio.git
synced 2025-02-01 00:52:01 +01:00
40 lines
No EOL
988 B
JavaScript
40 lines
No EOL
988 B
JavaScript
'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 }),
|
|
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(
|
|
[
|
|
await queryInterface.removeColumn('ap_users', 'following'),
|
|
])
|
|
}
|
|
}; |