aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0120-video-null.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-12-07 17:03:56 +0100
committerChocobozzz <florian.bigard@gmail.com>2017-12-07 17:05:23 +0100
commit8e7f08b5a5e65195ad6dd3d7850fda57021421f3 (patch)
tree1ee2bff1a5a51643e6b86c6f21e4766013a9213d /server/initializers/migrations/0120-video-null.ts
parent27e1a06c331278e5d37bc5172ee7e4fc968e4b5e (diff)
downloadPeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.tar.gz
PeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.tar.zst
PeerTube-8e7f08b5a5e65195ad6dd3d7850fda57021421f3.zip
Make some fields optional when uploading a video
Diffstat (limited to 'server/initializers/migrations/0120-video-null.ts')
-rw-r--r--server/initializers/migrations/0120-video-null.ts46
1 files changed, 46 insertions, 0 deletions
diff --git a/server/initializers/migrations/0120-video-null.ts b/server/initializers/migrations/0120-video-null.ts
new file mode 100644
index 000000000..3506a5046
--- /dev/null
+++ b/server/initializers/migrations/0120-video-null.ts
@@ -0,0 +1,46 @@
1import * as Sequelize from 'sequelize'
2import { PeerTubeDatabase } from '../database'
3
4async 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
39function down (options) {
40 throw new Error('Not implemented.')
41}
42
43export {
44 up,
45 down
46}