You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import {Instantiable, FactoryProducer} from '../../di'
|
|
|
|
import {Migrator} from './Migrator'
|
|
|
|
import {DatabaseMigrator} from './DatabaseMigrator'
|
|
|
|
import {ConfiguredSingletonFactory} from '../../di/factory/ConfiguredSingletonFactory'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A dependency injection factory that matches the abstract Migrator class
|
|
|
|
* and produces an instance of the configured session driver implementation.
|
|
|
|
*/
|
|
|
|
@FactoryProducer()
|
|
|
|
export class MigratorFactory extends ConfiguredSingletonFactory<Migrator> {
|
|
|
|
protected getConfigKey(): string {
|
|
|
|
return 'database.migrations.driver'
|
|
|
|
}
|
|
|
|
|
|
|
|
protected getDefaultImplementation(): Instantiable<Migrator> {
|
|
|
|
return DatabaseMigrator
|
|
|
|
}
|
|
|
|
|
|
|
|
protected getAbstractImplementation(): any {
|
|
|
|
return Migrator
|
|
|
|
}
|
|
|
|
}
|