aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0370-thumbnail.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-21 14:54:29 +0100
committerChocobozzz <me@florianbigard.com>2022-03-21 14:54:29 +0100
commit348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46 (patch)
tree972ec51091bab14e7671ef7db3b6e43ea5f116f7 /server/initializers/migrations/0370-thumbnail.ts
parente6afb669402aead6bf3d9d7ba4f2bd434c831eab (diff)
downloadPeerTube-348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46.tar.gz
PeerTube-348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46.tar.zst
PeerTube-348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46.zip
Remove old migration files
Diffstat (limited to 'server/initializers/migrations/0370-thumbnail.ts')
-rw-r--r--server/initializers/migrations/0370-thumbnail.ts50
1 files changed, 0 insertions, 50 deletions
diff --git a/server/initializers/migrations/0370-thumbnail.ts b/server/initializers/migrations/0370-thumbnail.ts
deleted file mode 100644
index 07c25436a..000000000
--- a/server/initializers/migrations/0370-thumbnail.ts
+++ /dev/null
@@ -1,50 +0,0 @@
1import * as Sequelize from 'sequelize'
2
3async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7 db: any
8}): Promise<void> {
9 {
10 const query = `
11CREATE TABLE IF NOT EXISTS "thumbnail"
12(
13 "id" SERIAL,
14 "filename" VARCHAR(255) NOT NULL,
15 "height" INTEGER DEFAULT NULL,
16 "width" INTEGER DEFAULT NULL,
17 "type" INTEGER NOT NULL,
18 "fileUrl" VARCHAR(255),
19 "videoId" INTEGER REFERENCES "video" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
20 "videoPlaylistId" INTEGER REFERENCES "videoPlaylist" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
21 "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL,
22 "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL,
23 PRIMARY KEY ("id")
24);`
25 await utils.sequelize.query(query)
26 }
27
28 {
29 // All video thumbnails
30 const query = 'INSERT INTO "thumbnail" ("filename", "type", "videoId", "height", "width", "createdAt", "updatedAt")' +
31 'SELECT uuid || \'.jpg\', 1, id, 110, 200, NOW(), NOW() FROM "video"'
32 await utils.sequelize.query(query)
33 }
34
35 {
36 // All video previews
37 const query = 'INSERT INTO "thumbnail" ("filename", "type", "videoId", "height", "width", "createdAt", "updatedAt")' +
38 'SELECT uuid || \'.jpg\', 2, id, 315, 560, NOW(), NOW() FROM "video"'
39 await utils.sequelize.query(query)
40 }
41}
42
43function down (options) {
44 throw new Error('Not implemented.')
45}
46
47export {
48 up,
49 down
50}