aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0005-email-pod.js
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-05-15 22:22:03 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-05-20 09:57:40 +0200
commit65fcc3119c334b75dd13bcfdebf186afdc580a8f (patch)
tree4f2158c61a9b7c3f47cfa233d01413b946ee53c0 /server/initializers/migrations/0005-email-pod.js
parentd5f345ed4cfac4e1fa84dcb4fce1cda4d32f9c73 (diff)
downloadPeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.gz
PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.tar.zst
PeerTube-65fcc3119c334b75dd13bcfdebf186afdc580a8f.zip
First typescript iteration
Diffstat (limited to 'server/initializers/migrations/0005-email-pod.js')
-rw-r--r--server/initializers/migrations/0005-email-pod.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/server/initializers/migrations/0005-email-pod.js b/server/initializers/migrations/0005-email-pod.js
deleted file mode 100644
index 9bbb354bf..000000000
--- a/server/initializers/migrations/0005-email-pod.js
+++ /dev/null
@@ -1,41 +0,0 @@
1'use strict'
2
3const waterfall = require('async/waterfall')
4
5// utils = { transaction, queryInterface, sequelize, Sequelize }
6exports.up = function (utils, finalCallback) {
7 const q = utils.queryInterface
8 const Sequelize = utils.Sequelize
9
10 const data = {
11 type: Sequelize.STRING(400),
12 allowNull: false,
13 defaultValue: ''
14 }
15
16 waterfall([
17
18 function addEmailColumn (callback) {
19 q.addColumn('Pods', 'email', data, { transaction: utils.transaction }).asCallback(function (err) {
20 return callback(err)
21 })
22 },
23
24 function updateWithFakeEmails (callback) {
25 const query = 'UPDATE "Pods" SET "email" = \'dummy@example.com\''
26 utils.sequelize.query(query, { transaction: utils.transaction }).asCallback(function (err) {
27 return callback(err)
28 })
29 },
30
31 function nullOnDefault (callback) {
32 data.defaultValue = null
33
34 q.changeColumn('Pods', 'email', data, { transaction: utils.transaction }).asCallback(callback)
35 }
36 ], finalCallback)
37}
38
39exports.down = function (options, callback) {
40 throw new Error('Not implemented.')
41}