]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/shared/update.ts
Translated using Weblate (Japanese)
[github/Chocobozzz/PeerTube.git] / server / models / shared / update.ts
index d338211e380bbc5cf27cf15148df1d09ec932016..d02c4535dc5ec02783d6bdd2891c3f01df23a30c 100644 (file)
@@ -1,9 +1,15 @@
-import { QueryTypes, Transaction } from 'sequelize'
-import { sequelizeTypescript } from '@server/initializers/database'
+import { QueryTypes, Sequelize, Transaction } from 'sequelize'
 
 // Sequelize always skip the update if we only update updatedAt field
-function setAsUpdated (table: string, id: number, transaction?: Transaction) {
-  return sequelizeTypescript.query(
+function setAsUpdated (options: {
+  sequelize: Sequelize
+  table: string
+  id: number
+  transaction?: Transaction
+}) {
+  const { sequelize, table, id, transaction } = options
+
+  return sequelize.query(
     `UPDATE "${table}" SET "updatedAt" = :updatedAt WHERE id = :id`,
     {
       replacements: { table, id, updatedAt: new Date() },