aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/miscs
diff options
context:
space:
mode:
Diffstat (limited to 'shared/extra-utils/miscs')
-rw-r--r--shared/extra-utils/miscs/sql.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/shared/extra-utils/miscs/sql.ts b/shared/extra-utils/miscs/sql.ts
index 345e5bc16..35e493456 100644
--- a/shared/extra-utils/miscs/sql.ts
+++ b/shared/extra-utils/miscs/sql.ts
@@ -130,6 +130,14 @@ function setActorFollowScores (internalServerNumber: number, newScore: number) {
130 return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options) 130 return seq.query(`UPDATE "actorFollow" SET "score" = ${newScore}`, options)
131} 131}
132 132
133function setTokenField (internalServerNumber: number, accessToken: string, field: string, value: string) {
134 const seq = getSequelize(internalServerNumber)
135
136 const options = { type: QueryTypes.UPDATE }
137
138 return seq.query(`UPDATE "oAuthToken" SET "${field}" = '${value}' WHERE "accessToken" = '${accessToken}'`, options)
139}
140
133export { 141export {
134 setVideoField, 142 setVideoField,
135 setPlaylistField, 143 setPlaylistField,
@@ -139,6 +147,7 @@ export {
139 setPluginLatestVersion, 147 setPluginLatestVersion,
140 selectQuery, 148 selectQuery,
141 deleteAll, 149 deleteAll,
150 setTokenField,
142 updateQuery, 151 updateQuery,
143 setActorFollowScores, 152 setActorFollowScores,
144 closeAllSequelize, 153 closeAllSequelize,