]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/models/application/application.ts
Stricter models typing
[github/Chocobozzz/PeerTube.git] / server / models / application / application.ts
index 3bba2c70e3600476dc7d22693e3f0f9e747eb20b..5531d134a1b6f67c14b6b9bc2b8483cccb2eb90d 100644 (file)
@@ -1,6 +1,7 @@
+import * as memoizee from 'memoizee'
 import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Model, Table } from 'sequelize-typescript'
+import { AttributesOnly } from '@shared/core-utils'
 import { AccountModel } from '../account/account'
-import * as memoizee from 'memoizee'
 
 export const getServerActor = memoizee(async function () {
   const application = await ApplicationModel.load()
@@ -24,7 +25,7 @@ export const getServerActor = memoizee(async function () {
   tableName: 'application',
   timestamps: false
 })
-export class ApplicationModel extends Model<ApplicationModel> {
+export class ApplicationModel extends Model<Partial<AttributesOnly<ApplicationModel>>> {
 
   @AllowNull(false)
   @Default(0)
@@ -32,6 +33,10 @@ export class ApplicationModel extends Model<ApplicationModel> {
   @Column
   migrationVersion: number
 
+  @AllowNull(true)
+  @Column
+  latestPeerTubeVersion: string
+
   @HasOne(() => AccountModel, {
     foreignKey: {
       allowNull: true