aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0010-email-user.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0010-email-user.ts')
-rw-r--r--server/initializers/migrations/0010-email-user.ts35
1 files changed, 0 insertions, 35 deletions
diff --git a/server/initializers/migrations/0010-email-user.ts b/server/initializers/migrations/0010-email-user.ts
deleted file mode 100644
index 4193b7ff9..000000000
--- a/server/initializers/migrations/0010-email-user.ts
+++ /dev/null
@@ -1,35 +0,0 @@
1import * as Sequelize from 'sequelize'
2import { Migration } from '../../models/migrations'
3
4function up (utils: {
5 transaction: Sequelize.Transaction
6 queryInterface: Sequelize.QueryInterface
7 sequelize: Sequelize.Sequelize
8}): Promise<void> {
9 const q = utils.queryInterface
10
11 const data = {
12 type: Sequelize.STRING(400),
13 allowNull: false,
14 defaultValue: ''
15 } as Migration.String
16 return q.addColumn('Users', 'email', data)
17 .then(() => {
18 const query = 'UPDATE "Users" SET "email" = CONCAT("username", \'@example.com\')'
19 return utils.sequelize.query(query, { transaction: utils.transaction })
20 })
21 .then(() => {
22 data.defaultValue = null
23
24 return q.changeColumn('Users', 'email', data)
25 })
26}
27
28function down (options) {
29 throw new Error('Not implemented.')
30}
31
32export {
33 up,
34 down
35}