PeerTube/server/initializers/migrations/0170-actor-follow-score.ts

29 lines
592 B
TypeScript
Raw Normal View History

import * as Sequelize from 'sequelize'
import { ACTOR_FOLLOW_SCORE } from '../constants'
async function up (utils: {
2020-01-31 09:56:52 -06:00
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
}): Promise<void> {
await utils.queryInterface.removeColumn('server', 'score')
const data = {
type: Sequelize.INTEGER,
allowNull: false,
defaultValue: ACTOR_FOLLOW_SCORE.BASE
}
await utils.queryInterface.addColumn('actorFollow', 'score', data)
}
function down (options) {
throw new Error('Not implemented.')
}
export {
up,
down
}