aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs/sql.ts
diff options
context:
space:
mode:
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}