diff options
Diffstat (limited to 'server/initializers/migrations/0235-delete-some-video-indexes.ts')
-rw-r--r-- | server/initializers/migrations/0235-delete-some-video-indexes.ts | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/server/initializers/migrations/0235-delete-some-video-indexes.ts b/server/initializers/migrations/0235-delete-some-video-indexes.ts deleted file mode 100644 index 5964b0dc5..000000000 --- a/server/initializers/migrations/0235-delete-some-video-indexes.ts +++ /dev/null | |||
@@ -1,37 +0,0 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | async function up (utils: { | ||
4 | transaction: Sequelize.Transaction | ||
5 | queryInterface: Sequelize.QueryInterface | ||
6 | sequelize: Sequelize.Sequelize | ||
7 | }): Promise<any> { | ||
8 | await utils.sequelize.query('DROP INDEX IF EXISTS video_id_privacy_state_wait_transcoding;') | ||
9 | await utils.sequelize.query('DROP INDEX IF EXISTS video_name;') | ||
10 | |||
11 | for (let i = 0; i < 5; i++) { | ||
12 | const query = 'DELETE FROM "videoFile" WHERE id IN ' + | ||
13 | '(SELECT id FROM (SELECT MIN(id) AS id, "videoId", "resolution", "fps" ' + | ||
14 | 'FROM "videoFile" GROUP BY "videoId", "resolution", "fps" HAVING COUNT(*) > 1) t)' | ||
15 | await utils.sequelize.query(query) | ||
16 | } | ||
17 | |||
18 | for (let i = 0; i < 5; i++) { | ||
19 | const query = 'DELETE FROM "actor" WHERE id IN ' + | ||
20 | '(SELECT id FROM (SELECT MIN(id) AS id, "uuid" ' + | ||
21 | 'FROM "actor" GROUP BY "uuid" HAVING COUNT(*) > 1) t)' | ||
22 | await utils.sequelize.query(query) | ||
23 | } | ||
24 | |||
25 | for (let i = 0; i < 5; i++) { | ||
26 | const query = 'DELETE FROM "account" WHERE id IN ' + | ||
27 | '(SELECT id FROM (SELECT MIN(id) AS id, "actorId" ' + | ||
28 | 'FROM "account" GROUP BY "actorId" HAVING COUNT(*) > 1) t)' | ||
29 | await utils.sequelize.query(query) | ||
30 | } | ||
31 | } | ||
32 | |||
33 | function down (options) { | ||
34 | throw new Error('Not implemented.') | ||
35 | } | ||
36 | |||
37 | export { up, down } | ||