aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0195-support.ts53
1 files changed, 53 insertions, 0 deletions
diff --git a/server/initializers/migrations/0195-support.ts b/server/initializers/migrations/0195-support.ts
new file mode 100644
index 000000000..8722a5f22
--- /dev/null
+++ b/server/initializers/migrations/0195-support.ts
@@ -0,0 +1,53 @@
1import * as Sequelize from 'sequelize'
2import { CONSTRAINTS_FIELDS } from '../index'
3
4async function up (utils: {
5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize
8}): Promise<void> {
9 {
10 const data = {
11 type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEOS.SUPPORT.max),
12 allowNull: true,
13 defaultValue: null
14 }
15 await utils.queryInterface.addColumn('video', 'support', data)
16 }
17
18 {
19 const data = {
20 type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEO_CHANNELS.SUPPORT.max),
21 allowNull: true,
22 defaultValue: null
23 }
24 await utils.queryInterface.addColumn('videoChannel', 'support', data)
25 }
26
27 {
28 const data = {
29 type: Sequelize.STRING(CONSTRAINTS_FIELDS.USERS.DESCRIPTION.max),
30 allowNull: true,
31 defaultValue: null
32 }
33 await utils.queryInterface.addColumn('account', 'description', data)
34 }
35
36 {
37 const data = {
38 type: Sequelize.STRING(CONSTRAINTS_FIELDS.VIDEOS.DESCRIPTION.max),
39 allowNull: true,
40 defaultValue: null
41 }
42 await utils.queryInterface.changeColumn('video', 'description', data)
43 }
44}
45
46function down (options) {
47 throw new Error('Not implemented.')
48}
49
50export {
51 up,
52 down
53}