From 156c50af3085468a47b8ae73fe8cfcae46b42398 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Sat, 6 Oct 2018 19:17:21 +0200 Subject: Add downloadingEnabled property to video model --- .../migrations/0280-video-downloading-enabled.ts | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 server/initializers/migrations/0280-video-downloading-enabled.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0280-video-downloading-enabled.ts b/server/initializers/migrations/0280-video-downloading-enabled.ts new file mode 100644 index 000000000..c0700108c --- /dev/null +++ b/server/initializers/migrations/0280-video-downloading-enabled.ts @@ -0,0 +1,27 @@ +import * as Sequelize from 'sequelize' +import { Migration } from '../../models/migrations' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: true + } as Migration.Boolean + await utils.queryInterface.addColumn('video', 'downloadingEnabled', data) + + data.defaultValue = null + return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data) +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3 From 7f2cfe3a792856f7de6f1d13688aa3d06ec1bf70 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Mon, 8 Oct 2018 14:45:22 +0200 Subject: Rename downloadingEnabled property to downloadEnabled --- server/initializers/migrations/0280-video-downloading-enabled.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0280-video-downloading-enabled.ts b/server/initializers/migrations/0280-video-downloading-enabled.ts index c0700108c..e79466447 100644 --- a/server/initializers/migrations/0280-video-downloading-enabled.ts +++ b/server/initializers/migrations/0280-video-downloading-enabled.ts @@ -11,10 +11,10 @@ async function up (utils: { allowNull: false, defaultValue: true } as Migration.Boolean - await utils.queryInterface.addColumn('video', 'downloadingEnabled', data) + await utils.queryInterface.addColumn('video', 'downloadEnabled', data) data.defaultValue = null - return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data) + return utils.queryInterface.changeColumn('video', 'downloadEnabled', data) } function down (options) { -- cgit v1.2.3 From 5abb9fbbd12e7097e348d6a38622d364b1fa47ed Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 10 Jan 2019 15:39:51 +0100 Subject: Add ability to unfederate a local video (on blacklist) --- .../migrations/0320-blacklist-unfederate.ts | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 server/initializers/migrations/0320-blacklist-unfederate.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0320-blacklist-unfederate.ts b/server/initializers/migrations/0320-blacklist-unfederate.ts new file mode 100644 index 000000000..6fb7bbb90 --- /dev/null +++ b/server/initializers/migrations/0320-blacklist-unfederate.ts @@ -0,0 +1,27 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + + { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: false + } + + await utils.queryInterface.addColumn('videoBlacklist', 'unfederated', data) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3 From 1506307f2f903ce0f80155072a33345c702b7c76 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 14 Jan 2019 16:48:38 +0100 Subject: Increase abuse length to 3000 And correctly handle new lines --- .../migrations/0325-video-abuse-fields.ts | 37 ++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 server/initializers/migrations/0325-video-abuse-fields.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0325-video-abuse-fields.ts b/server/initializers/migrations/0325-video-abuse-fields.ts new file mode 100644 index 000000000..fca6d666f --- /dev/null +++ b/server/initializers/migrations/0325-video-abuse-fields.ts @@ -0,0 +1,37 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + + { + const data = { + type: Sequelize.STRING(3000), + allowNull: false, + defaultValue: null + } + + await utils.queryInterface.changeColumn('videoAbuse', 'reason', data) + } + + { + const data = { + type: Sequelize.STRING(3000), + allowNull: true, + defaultValue: null + } + + await utils.queryInterface.changeColumn('videoAbuse', 'moderationComment', data) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3 From 092092969633bbcf6d4891a083ea497a7d5c3154 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 29 Jan 2019 08:37:25 +0100 Subject: Add hls support on server --- .../migrations/0330-video-streaming-playlist.ts | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 server/initializers/migrations/0330-video-streaming-playlist.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0330-video-streaming-playlist.ts b/server/initializers/migrations/0330-video-streaming-playlist.ts new file mode 100644 index 000000000..c85a762ab --- /dev/null +++ b/server/initializers/migrations/0330-video-streaming-playlist.ts @@ -0,0 +1,51 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + + { + const query = ` + CREATE TABLE IF NOT EXISTS "videoStreamingPlaylist" +( + "id" SERIAL, + "type" INTEGER NOT NULL, + "playlistUrl" VARCHAR(2000) NOT NULL, + "p2pMediaLoaderInfohashes" VARCHAR(255)[] NOT NULL, + "segmentsSha256Url" VARCHAR(255) NOT NULL, + "videoId" INTEGER NOT NULL REFERENCES "video" ("id") ON DELETE CASCADE ON UPDATE CASCADE, + "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL, + "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL, + PRIMARY KEY ("id") +);` + await utils.sequelize.query(query) + } + + { + const data = { + type: Sequelize.INTEGER, + allowNull: true, + defaultValue: null + } + + await utils.queryInterface.changeColumn('videoRedundancy', 'videoFileId', data) + } + + { + const query = 'ALTER TABLE "videoRedundancy" ADD COLUMN "videoStreamingPlaylistId" INTEGER NULL ' + + 'REFERENCES "videoStreamingPlaylist" ("id") ON DELETE CASCADE ON UPDATE CASCADE' + + await utils.sequelize.query(query) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3 From 25451e08c71b81ee3da75d65eab22445a78dd0c2 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 11 Feb 2019 11:55:11 +0100 Subject: Update migration version for download enabled --- .../migrations/0280-video-downloading-enabled.ts | 27 ---------------------- .../migrations/0335-video-downloading-enabled.ts | 27 ++++++++++++++++++++++ 2 files changed, 27 insertions(+), 27 deletions(-) delete mode 100644 server/initializers/migrations/0280-video-downloading-enabled.ts create mode 100644 server/initializers/migrations/0335-video-downloading-enabled.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0280-video-downloading-enabled.ts b/server/initializers/migrations/0280-video-downloading-enabled.ts deleted file mode 100644 index e79466447..000000000 --- a/server/initializers/migrations/0280-video-downloading-enabled.ts +++ /dev/null @@ -1,27 +0,0 @@ -import * as Sequelize from 'sequelize' -import { Migration } from '../../models/migrations' - -async function up (utils: { - transaction: Sequelize.Transaction, - queryInterface: Sequelize.QueryInterface, - sequelize: Sequelize.Sequelize -}): Promise { - const data = { - type: Sequelize.BOOLEAN, - allowNull: false, - defaultValue: true - } as Migration.Boolean - await utils.queryInterface.addColumn('video', 'downloadEnabled', data) - - data.defaultValue = null - return utils.queryInterface.changeColumn('video', 'downloadEnabled', data) -} - -function down (options) { - throw new Error('Not implemented.') -} - -export { - up, - down -} diff --git a/server/initializers/migrations/0335-video-downloading-enabled.ts b/server/initializers/migrations/0335-video-downloading-enabled.ts new file mode 100644 index 000000000..e79466447 --- /dev/null +++ b/server/initializers/migrations/0335-video-downloading-enabled.ts @@ -0,0 +1,27 @@ +import * as Sequelize from 'sequelize' +import { Migration } from '../../models/migrations' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: true + } as Migration.Boolean + await utils.queryInterface.addColumn('video', 'downloadEnabled', data) + + data.defaultValue = null + return utils.queryInterface.changeColumn('video', 'downloadEnabled', data) +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3