2017-05-22 20:58:25 +02:00
|
|
|
import * as Sequelize from 'sequelize'
|
2017-07-05 13:26:25 +02:00
|
|
|
import * as Promise from 'bluebird'
|
2017-05-22 20:58:25 +02:00
|
|
|
|
|
|
|
export namespace ApplicationMethods {
|
2017-07-05 13:26:25 +02:00
|
|
|
export type LoadMigrationVersion = () => Promise<number>
|
2017-06-10 22:15:25 +02:00
|
|
|
|
2017-07-05 13:26:25 +02:00
|
|
|
export type UpdateMigrationVersion = (
|
|
|
|
newVersion: number,
|
|
|
|
transaction: Sequelize.Transaction
|
|
|
|
) => Promise<[ number, ApplicationInstance[] ]>
|
2017-05-22 20:58:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
export interface ApplicationClass {
|
|
|
|
loadMigrationVersion: ApplicationMethods.LoadMigrationVersion
|
|
|
|
updateMigrationVersion: ApplicationMethods.UpdateMigrationVersion
|
|
|
|
}
|
|
|
|
|
|
|
|
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> {}
|