aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs/sql.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2019-07-19 14:36:04 +0200
committerChocobozzz <chocobozzz@cpy.re>2019-07-24 10:58:16 +0200
commit09071200c73f5358e1d0bfb61a274e4f2c4ec52b (patch)
tree602749b149df1675518846dd223105196b19a557 /shared/extra-utils/miscs/sql.ts
parent9b474844e85cce916370693cc24f53339a695570 (diff)
downloadPeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.gz
PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.zst
PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.zip
Add plugin API tests
Diffstat (limited to 'shared/extra-utils/miscs/sql.ts')
-rw-r--r--shared/extra-utils/miscs/sql.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/shared/extra-utils/miscs/sql.ts b/shared/extra-utils/miscs/sql.ts
index 34477cb78..1961a8762 100644
--- a/shared/extra-utils/miscs/sql.ts
+++ b/shared/extra-utils/miscs/sql.ts
@@ -1,5 +1,6 @@
1import { QueryTypes, Sequelize } from 'sequelize' 1import { QueryTypes, Sequelize } from 'sequelize'
2import { ServerInfo } from '../server/servers' 2import { ServerInfo } from '../server/servers'
3import { PluginType } from '../../models/plugins/plugin.type'
3 4
4let sequelizes: { [ id: number ]: Sequelize } = {} 5let sequelizes: { [ id: number ]: Sequelize } = {}
5 6
@@ -72,10 +73,19 @@ async function closeAllSequelize (servers: ServerInfo[]) {
72 } 73 }
73} 74}
74 75
76function setPluginVersion (internalServerNumber: number, pluginName: string, newVersion: string) {
77 const seq = getSequelize(internalServerNumber)
78
79 const options = { type: QueryTypes.UPDATE }
80
81 return seq.query(`UPDATE "plugin" SET "version" = '${newVersion}' WHERE "name" = '${pluginName}'`, options)
82}
83
75export { 84export {
76 setVideoField, 85 setVideoField,
77 setPlaylistField, 86 setPlaylistField,
78 setActorField, 87 setActorField,
79 countVideoViewsOf, 88 countVideoViewsOf,
89 setPluginVersion,
80 closeAllSequelize 90 closeAllSequelize
81} 91}