]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blob - server/initializers/migrations/0120-video-null.ts
Make some fields optional when uploading a video
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0120-video-null.ts
1 import * as Sequelize from 'sequelize'
2 import { PeerTubeDatabase } from '../database'
3
4 async function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize,
8 db: PeerTubeDatabase
9 }): Promise<void> {
10
11 {
12 const data = {
13 type: Sequelize.INTEGER,
14 allowNull: true,
15 defaultValue: null
16 }
17 await utils.queryInterface.changeColumn('Videos', 'licence', data)
18 }
19
20 {
21 const data = {
22 type: Sequelize.INTEGER,
23 allowNull: true,
24 defaultValue: null
25 }
26 await utils.queryInterface.changeColumn('Videos', 'category', data)
27 }
28
29 {
30 const data = {
31 type: Sequelize.INTEGER,
32 allowNull: true,
33 defaultValue: null
34 }
35 await utils.queryInterface.changeColumn('Videos', 'description', data)
36 }
37 }
38
39 function down (options) {
40 throw new Error('Not implemented.')
41 }
42
43 export {
44 up,
45 down
46 }