diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-16 09:45:46 +0200 |
commit | 74889a71fe687dda74f2a687653122327807af36 (patch) | |
tree | e938e8b6401b74fbec80513a877d9967f2c0dbcd /server/models/application/application-interface.ts | |
parent | 15a302943d84bc0978b84fe33110c4daa451d311 (diff) | |
download | PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.gz PeerTube-74889a71fe687dda74f2a687653122327807af36.tar.zst PeerTube-74889a71fe687dda74f2a687653122327807af36.zip |
Reorganize model files
Diffstat (limited to 'server/models/application/application-interface.ts')
-rw-r--r-- | server/models/application/application-interface.ts | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/server/models/application/application-interface.ts b/server/models/application/application-interface.ts new file mode 100644 index 000000000..c03513db1 --- /dev/null +++ b/server/models/application/application-interface.ts | |||
@@ -0,0 +1,26 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | export namespace ApplicationMethods { | ||
4 | export type LoadMigrationVersionCallback = (err: Error, version: number) => void | ||
5 | export type LoadMigrationVersion = (callback: LoadMigrationVersionCallback) => void | ||
6 | |||
7 | export type UpdateMigrationVersionCallback = (err: Error, applicationInstance: ApplicationAttributes) => void | ||
8 | export type UpdateMigrationVersion = (newVersion: number, transaction: Sequelize.Transaction, callback: UpdateMigrationVersionCallback) => void | ||
9 | } | ||
10 | |||
11 | export interface ApplicationClass { | ||
12 | loadMigrationVersion: ApplicationMethods.LoadMigrationVersion | ||
13 | updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion | ||
14 | } | ||
15 | |||
16 | export interface ApplicationAttributes { | ||
17 | migrationVersion: number | ||
18 | } | ||
19 | |||
20 | export interface ApplicationInstance extends ApplicationClass, ApplicationAttributes, Sequelize.Instance<ApplicationAttributes> { | ||
21 | id: number | ||
22 | createdAt: Date | ||
23 | updatedAt: Date | ||
24 | } | ||
25 | |||
26 | export interface ApplicationModel extends ApplicationClass, Sequelize.Model<ApplicationInstance, ApplicationAttributes> {} | ||