]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/migrations/0135-video-channel-actor.ts
Add url field in caption and use it for thumbnails
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0135-video-channel-actor.ts
index 3c5c10ad69dc5bff6aab49c72e8c1862df41d6a8..5ace0f4d27dcdc3e8126ad122005abe333759bab 100644 (file)
@@ -1,6 +1,6 @@
 import * as Sequelize from 'sequelize'
 import { DataType } from 'sequelize-typescript'
-import { createPrivateAndPublicKeys } from '../../helpers'
+import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto'
 
 async function up (utils: {
   transaction: Sequelize.Transaction,
@@ -39,15 +39,7 @@ async function up (utils: {
         "createdAt" timestamp with time zone NOT NULL,
         "updatedAt" timestamp with time zone NOT NULL
       );`,
-      `
-      CREATE SEQUENCE actor_id_seq
-      AS integer
-      START WITH 1
-      INCREMENT BY 1
-      NO MINVALUE
-      NO MAXVALUE
-      CACHE 1
-      `,
+      `CREATE SEQUENCE actor_id_seq START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 1`,
       `ALTER SEQUENCE actor_id_seq OWNED BY actor.id`,
       `ALTER TABLE ONLY actor ALTER COLUMN id SET DEFAULT nextval('actor_id_seq'::regclass)`,
       `ALTER TABLE ONLY actor ADD CONSTRAINT actor_pkey PRIMARY KEY (id);`,
@@ -247,7 +239,8 @@ async function up (utils: {
 
   {
     const query = 'SELECT * FROM "actor" WHERE "serverId" IS NULL AND "publicKey" IS NULL'
-    const [ res ] = await utils.sequelize.query(query)
+    const options = { type: Sequelize.QueryTypes.SELECT as Sequelize.QueryTypes.SELECT }
+    const [ res ] = await utils.sequelize.query(query, options)
 
     for (const actor of res) {
       const { privateKey, publicKey } = await createPrivateAndPublicKeys()