PeerTube/server/initializers/migrations/0280-webtorrent-policy-user.ts

29 lines
650 B
TypeScript
Raw Normal View History

import * as Sequelize from 'sequelize'
async function up (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
}): Promise<any> {
{
const data = {
2018-10-12 18:12:39 +02:00
type: Sequelize.BOOLEAN,
allowNull: false,
2018-10-12 18:12:39 +02:00
defaultValue: true
}
2018-10-12 18:12:39 +02:00
await utils.queryInterface.addColumn('user', 'webTorrentEnabled', data)
}
}
2018-10-12 18:12:39 +02:00
async function down (utils: {
transaction: Sequelize.Transaction
queryInterface: Sequelize.QueryInterface
sequelize: Sequelize.Sequelize
}): Promise<any> {
await utils.queryInterface.removeColumn('user', 'webTorrentEnabled')
}
export { up, down }