diff options
Diffstat (limited to 'server/initializers/migrations/0660-object-storage.ts')
-rw-r--r-- | server/initializers/migrations/0660-object-storage.ts | 56 |
1 files changed, 0 insertions, 56 deletions
diff --git a/server/initializers/migrations/0660-object-storage.ts b/server/initializers/migrations/0660-object-storage.ts deleted file mode 100644 index 53cb89ce6..000000000 --- a/server/initializers/migrations/0660-object-storage.ts +++ /dev/null | |||
@@ -1,56 +0,0 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | import { VideoStorage } from '@shared/models' | ||
3 | |||
4 | async function up (utils: { | ||
5 | transaction: Sequelize.Transaction | ||
6 | queryInterface: Sequelize.QueryInterface | ||
7 | sequelize: Sequelize.Sequelize | ||
8 | db: any | ||
9 | }): Promise<void> { | ||
10 | { | ||
11 | const query = ` | ||
12 | CREATE TABLE IF NOT EXISTS "videoJobInfo" ( | ||
13 | "id" serial, | ||
14 | "pendingMove" INTEGER NOT NULL, | ||
15 | "pendingTranscode" INTEGER NOT NULL, | ||
16 | "videoId" serial UNIQUE NOT NULL REFERENCES "video" ("id") ON DELETE CASCADE ON UPDATE CASCADE, | ||
17 | "createdAt" timestamp WITH time zone NOT NULL, | ||
18 | "updatedAt" timestamp WITH time zone NOT NULL, | ||
19 | PRIMARY KEY ("id") | ||
20 | ); | ||
21 | ` | ||
22 | |||
23 | await utils.sequelize.query(query) | ||
24 | } | ||
25 | |||
26 | { | ||
27 | await utils.queryInterface.addColumn('videoFile', 'storage', { | ||
28 | type: Sequelize.INTEGER, | ||
29 | allowNull: true, | ||
30 | defaultValue: VideoStorage.FILE_SYSTEM | ||
31 | }) | ||
32 | await utils.queryInterface.changeColumn('videoFile', 'storage', { type: Sequelize.INTEGER, allowNull: false, defaultValue: null }) | ||
33 | } | ||
34 | |||
35 | { | ||
36 | await utils.queryInterface.addColumn('videoStreamingPlaylist', 'storage', { | ||
37 | type: Sequelize.INTEGER, | ||
38 | allowNull: true, | ||
39 | defaultValue: VideoStorage.FILE_SYSTEM | ||
40 | }) | ||
41 | await utils.queryInterface.changeColumn('videoStreamingPlaylist', 'storage', { | ||
42 | type: Sequelize.INTEGER, | ||
43 | allowNull: false, | ||
44 | defaultValue: null | ||
45 | }) | ||
46 | } | ||
47 | } | ||
48 | |||
49 | function down (options) { | ||
50 | throw new Error('Not implemented.') | ||
51 | } | ||
52 | |||
53 | export { | ||
54 | up, | ||
55 | down | ||
56 | } | ||