diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-12-11 11:06:32 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-12-11 11:06:32 +0100 |
commit | fada8d75550dc7365f7e18ee1569b9406251d660 (patch) | |
tree | db9dc01c18693824f83fce5020f4c1f3ae7c0865 /server/initializers/migrations/0120-video-null.ts | |
parent | 492fd28167f770d79a430fc57451b5a9e075d8e7 (diff) | |
parent | c2830fa8f84f61462098bf36add824f89436dfa9 (diff) | |
download | PeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.tar.gz PeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.tar.zst PeerTube-fada8d75550dc7365f7e18ee1569b9406251d660.zip |
Merge branch 'feature/design' into develop
Diffstat (limited to 'server/initializers/migrations/0120-video-null.ts')
-rw-r--r-- | server/initializers/migrations/0120-video-null.ts | 47 |
1 files changed, 47 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..9130d10ee --- /dev/null +++ b/server/initializers/migrations/0120-video-null.ts | |||
@@ -0,0 +1,47 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | import { CONSTRAINTS_FIELDS } from '../constants' | ||
3 | import { PeerTubeDatabase } from '../database' | ||
4 | |||
5 | async function up (utils: { | ||
6 | transaction: Sequelize.Transaction, | ||
7 | queryInterface: Sequelize.QueryInterface, | ||
8 | sequelize: Sequelize.Sequelize, | ||
9 | db: PeerTubeDatabase | ||
10 | }): Promise<void> { | ||
11 | |||
12 | { | ||
13 | const data = { | ||
14 | type: Sequelize.INTEGER, | ||
15 | allowNull: true, | ||
16 | defaultValue: null | ||
17 | } | ||
18 | await utils.queryInterface.changeColumn('Videos', 'licence', data) | ||
19 | } | ||
20 | |||
21 | { | ||
22 | const data = { | ||
23 | type: Sequelize.INTEGER, | ||
24 | allowNull: true, | ||
25 | defaultValue: null | ||
26 | } | ||
27 | await utils.queryInterface.changeColumn('Videos', 'category', data) | ||
28 | } | ||
29 | |||
30 | { | ||
31 | const data = { | ||
32 | type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEOS.DESCRIPTION.max), | ||
33 | allowNull: true, | ||
34 | defaultValue: null | ||
35 | } | ||
36 | await utils.queryInterface.changeColumn('Videos', 'description', data) | ||
37 | } | ||
38 | } | ||
39 | |||
40 | function down (options) { | ||
41 | throw new Error('Not implemented.') | ||
42 | } | ||
43 | |||
44 | export { | ||
45 | up, | ||
46 | down | ||
47 | } | ||