2017-05-22 13:58:25 -05:00
|
|
|
import * as Sequelize from 'sequelize'
|
2017-11-14 10:31:26 -06:00
|
|
|
import * as Bluebird from 'bluebird'
|
2017-05-22 13:58:25 -05:00
|
|
|
|
|
|
|
export namespace ApplicationMethods {
|
2017-11-14 10:31:26 -06:00
|
|
|
export type LoadMigrationVersion = () => Bluebird<number>
|
2017-06-10 15:15:25 -05:00
|
|
|
|
2017-07-05 06:26:25 -05:00
|
|
|
export type UpdateMigrationVersion = (
|
|
|
|
newVersion: number,
|
|
|
|
transaction: Sequelize.Transaction
|
2017-11-14 10:31:26 -06:00
|
|
|
) => Bluebird<[ number, ApplicationInstance[] ]>
|
|
|
|
|
|
|
|
export type CountTotal = () => Bluebird<number>
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationClass {
|
|
|
|
loadMigrationVersion: ApplicationMethods.LoadMigrationVersion
|
|
|
|
updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion
|
2017-11-14 10:31:26 -06:00
|
|
|
countTotal: ApplicationMethods.CountTotal
|
2017-05-22 13:58:25 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationAttributes {
|
|
|
|
migrationVersion: number
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationInstance extends ApplicationClass, ApplicationAttributes, Sequelize.Instance<ApplicationAttributes> {
|
|
|
|
id: number
|
|
|
|
createdAt: Date
|
|
|
|
updatedAt: Date
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationModel extends ApplicationClass, Sequelize.Model<ApplicationInstance, ApplicationAttributes> {}
|