0170-actor-follow-score.ts 594 B

12345678910111213141516171819202122232425262728
  1. import * as Sequelize from 'sequelize'
  2. import { ACTOR_FOLLOW_SCORE } from '../constants'
  3. async function up (utils: {
  4. transaction: Sequelize.Transaction,
  5. queryInterface: Sequelize.QueryInterface,
  6. sequelize: Sequelize.Sequelize
  7. }): Promise<void> {
  8. await utils.queryInterface.removeColumn('server', 'score')
  9. const data = {
  10. type: Sequelize.INTEGER,
  11. allowNull: false,
  12. defaultValue: ACTOR_FOLLOW_SCORE.BASE
  13. }
  14. await utils.queryInterface.addColumn('actorFollow', 'score', data)
  15. }
  16. function down (options) {
  17. throw new Error('Not implemented.')
  18. }
  19. export {
  20. up,
  21. down
  22. }