From 63dc589865fa1882d38f1d9e0050d2341869d487 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 21 May 2019 13:14:27 +0200 Subject: Fix video views --- .../migrations/0380-cleanup-timestamps.ts | 29 ++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 server/initializers/migrations/0380-cleanup-timestamps.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0380-cleanup-timestamps.ts b/server/initializers/migrations/0380-cleanup-timestamps.ts new file mode 100644 index 000000000..2a9fd6f02 --- /dev/null +++ b/server/initializers/migrations/0380-cleanup-timestamps.ts @@ -0,0 +1,29 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: any +}): Promise { + try { + await utils.queryInterface.removeColumn('application', 'createdAt') + } catch { /* the column could not exist */ } + + try { + await utils.queryInterface.removeColumn('application', 'updatedAt') + } catch { /* the column could not exist */ } + + try { + await utils.queryInterface.removeColumn('videoView', 'updatedAt') + } catch { /* the column could not exist */ } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3