From eb7a06c812a464e0ea2e75c03999426a2eaef4a5 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 28 Nov 2017 10:00:02 +0100 Subject: [PATCH] Fix migration for Servers table --- server/initializers/constants.ts | 2 +- .../migrations/0105-server-mail.ts | 20 +++++++++++++++++++ .../migrations/0110-server-key.ts | 20 +++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 server/initializers/migrations/0105-server-mail.ts create mode 100644 server/initializers/migrations/0110-server-key.ts diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 786334d46..f09422ffd 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -14,7 +14,7 @@ import { FollowState } from '../../shared/models/accounts/follow.model' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 100 +const LAST_MIGRATION_VERSION = 110 // --------------------------------------------------------------------------- diff --git a/server/initializers/migrations/0105-server-mail.ts b/server/initializers/migrations/0105-server-mail.ts new file mode 100644 index 000000000..5836992d5 --- /dev/null +++ b/server/initializers/migrations/0105-server-mail.ts @@ -0,0 +1,20 @@ +import * as Sequelize from 'sequelize' +import { PeerTubeDatabase } from '../database' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: PeerTubeDatabase +}): Promise { + await utils.queryInterface.removeColumn('Servers', 'email') +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} diff --git a/server/initializers/migrations/0110-server-key.ts b/server/initializers/migrations/0110-server-key.ts new file mode 100644 index 000000000..560353945 --- /dev/null +++ b/server/initializers/migrations/0110-server-key.ts @@ -0,0 +1,20 @@ +import * as Sequelize from 'sequelize' +import { PeerTubeDatabase } from '../database' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: PeerTubeDatabase +}): Promise { + await utils.queryInterface.removeColumn('Servers', 'publicKey') +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +}