From 587568e1cc0e33c023c1ac62dd28fef313285250 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 22 Jul 2019 11:18:22 +0200 Subject: Add plugin table migration table --- server/initializers/migrations/0405-plugin.ts | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 server/initializers/migrations/0405-plugin.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0405-plugin.ts b/server/initializers/migrations/0405-plugin.ts new file mode 100644 index 000000000..c55b81960 --- /dev/null +++ b/server/initializers/migrations/0405-plugin.ts @@ -0,0 +1,40 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize, + db: any +}): Promise { + { + const query = ` +CREATE TABLE IF NOT EXISTS "plugin" +( + "id" SERIAL, + "name" VARCHAR(255) NOT NULL, + "type" INTEGER NOT NULL, + "version" VARCHAR(255) NOT NULL, + "latestVersion" VARCHAR(255), + "enabled" BOOLEAN NOT NULL, + "uninstalled" BOOLEAN NOT NULL, + "peertubeEngine" VARCHAR(255) NOT NULL, + "description" VARCHAR(255), + "homepage" VARCHAR(255) NOT NULL, + "settings" JSONB, + "storage" JSONB, + "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, + "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, + PRIMARY KEY ("id") +);` + await utils.sequelize.query(query) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3