[refactor] s/fed_user/ap_user

This commit is contained in:
les
2019-12-04 01:20:31 +01:00
parent c43fe095a5
commit 5052ceca0a
17 changed files with 214 additions and 123 deletions

View 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')
}
}

View 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');
*/
}
};

View 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');
*/
}
};