Begin moving video channel to actor

This commit is contained in:
Chocobozzz 2017-12-14 17:38:41 +01:00
parent fadf619ad6
commit 50d6de9c28
No known key found for this signature in database
GPG key ID: 583A612D890159BE
100 changed files with 1761 additions and 2041 deletions

View file

@ -1,5 +1,14 @@
import { AllowNull, Column, Default, IsInt, Model, Table } from 'sequelize-typescript'
import { AllowNull, Column, Default, DefaultScope, HasOne, IsInt, Model, Table } from 'sequelize-typescript'
import { AccountModel } from '../account/account'
@DefaultScope({
include: [
{
model: () => AccountModel,
required: true
}
]
})
@Table({
tableName: 'application'
})
@ -11,7 +20,19 @@ export class ApplicationModel extends Model<ApplicationModel> {
@Column
migrationVersion: number
@HasOne(() => AccountModel, {
foreignKey: {
allowNull: true
},
onDelete: 'cascade'
})
Account: AccountModel
static countTotal () {
return ApplicationModel.count()
}
static load () {
return ApplicationModel.findOne()
}
}