diff options
author | Chocobozzz <me@florianbigard.com> | 2019-07-19 14:36:04 +0200 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-07-24 10:58:16 +0200 |
commit | 09071200c73f5358e1d0bfb61a274e4f2c4ec52b (patch) | |
tree | 602749b149df1675518846dd223105196b19a557 /shared/extra-utils/miscs | |
parent | 9b474844e85cce916370693cc24f53339a695570 (diff) | |
download | PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.gz PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.tar.zst PeerTube-09071200c73f5358e1d0bfb61a274e4f2c4ec52b.zip |
Add plugin API tests
Diffstat (limited to 'shared/extra-utils/miscs')
-rw-r--r-- | shared/extra-utils/miscs/sql.ts | 10 |
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 @@ | |||
1 | import { QueryTypes, Sequelize } from 'sequelize' | 1 | import { QueryTypes, Sequelize } from 'sequelize' |
2 | import { ServerInfo } from '../server/servers' | 2 | import { ServerInfo } from '../server/servers' |
3 | import { PluginType } from '../../models/plugins/plugin.type' | ||
3 | 4 | ||
4 | let sequelizes: { [ id: number ]: Sequelize } = {} | 5 | let sequelizes: { [ id: number ]: Sequelize } = {} |
5 | 6 | ||
@@ -72,10 +73,19 @@ async function closeAllSequelize (servers: ServerInfo[]) { | |||
72 | } | 73 | } |
73 | } | 74 | } |
74 | 75 | ||
76 | function 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 | |||
75 | export { | 84 | export { |
76 | setVideoField, | 85 | setVideoField, |
77 | setPlaylistField, | 86 | setPlaylistField, |
78 | setActorField, | 87 | setActorField, |
79 | countVideoViewsOf, | 88 | countVideoViewsOf, |
89 | setPluginVersion, | ||
80 | closeAllSequelize | 90 | closeAllSequelize |
81 | } | 91 | } |