[refactor] s/fed_user/ap_user
This commit is contained in:
18
server/migrations/20191116145701-followers.js
Normal file
18
server/migrations/20191116145701-followers.js
Normal file
@@ -0,0 +1,18 @@
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.addColumn('fed_users', 'follower', {
|
||||
type: Sequelize.BOOLEAN
|
||||
})
|
||||
|
||||
// const users = queryInterface.sequelize.query('SELECT ')
|
||||
// const followers = users.reduce((followers, user) => followers.concat(user.followers), [])
|
||||
// console.error(followers)
|
||||
// const followers = await Sequelize.models.user_followers.findAll()
|
||||
// console.error(followers)
|
||||
// get current followers
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
return queryInterface.removeColumn('fed_users', 'follower')
|
||||
}
|
||||
}
|
||||
24
server/migrations/20191128002750-rename_fed_user_ap_user.js
Normal file
24
server/migrations/20191128002750-rename_fed_user_ap_user.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add altering commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
return queryInterface.renameTable('fed_users', 'ap_users')
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
};
|
||||
24
server/migrations/20191128002915-rename_fed_user_ap_user2.js
Normal file
24
server/migrations/20191128002915-rename_fed_user_ap_user2.js
Normal file
@@ -0,0 +1,24 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add altering commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.createTable('users', { id: Sequelize.INTEGER });
|
||||
*/
|
||||
return queryInterface.renameColumn('resources', 'fedUserApId', 'apUserApId')
|
||||
},
|
||||
|
||||
down: (queryInterface, Sequelize) => {
|
||||
/*
|
||||
Add reverting commands here.
|
||||
Return a promise to correctly handle asynchronicity.
|
||||
|
||||
Example:
|
||||
return queryInterface.dropTable('users');
|
||||
*/
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user