diff options
Diffstat (limited to 'shared/extra-utils/miscs/sql.ts')
-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 | } |