From 65fcc3119c334b75dd13bcfdebf186afdc580a8f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 15 May 2017 22:22:03 +0200 Subject: First typescript iteration --- server/initializers/migrations/0010-email-user.js | 41 ----------------------- 1 file changed, 41 deletions(-) delete mode 100644 server/initializers/migrations/0010-email-user.js (limited to 'server/initializers/migrations/0010-email-user.js') diff --git a/server/initializers/migrations/0010-email-user.js b/server/initializers/migrations/0010-email-user.js deleted file mode 100644 index 1ab27133a..000000000 --- a/server/initializers/migrations/0010-email-user.js +++ /dev/null @@ -1,41 +0,0 @@ -'use strict' - -const waterfall = require('async/waterfall') - -// utils = { transaction, queryInterface, sequelize, Sequelize } -exports.up = function (utils, finalCallback) { - const q = utils.queryInterface - const Sequelize = utils.Sequelize - - const data = { - type: Sequelize.STRING(400), - allowNull: false, - defaultValue: '' - } - - waterfall([ - - function addEmailColumn (callback) { - q.addColumn('Users', 'email', data, { transaction: utils.transaction }).asCallback(function (err) { - return callback(err) - }) - }, - - function updateWithFakeEmails (callback) { - const query = 'UPDATE "Users" SET "email" = CONCAT("username", \'@example.com\')' - utils.sequelize.query(query, { transaction: utils.transaction }).asCallback(function (err) { - return callback(err) - }) - }, - - function nullOnDefault (callback) { - data.defaultValue = null - - q.changeColumn('Users', 'email', data, { transaction: utils.transaction }).asCallback(callback) - } - ], finalCallback) -} - -exports.down = function (options, callback) { - throw new Error('Not implemented.') -} -- cgit v1.2.3