import Migrations from './Migrations' ; export default class MigrationExecutor { db : IDBDatabase ; migrationsBuilder : Migrations ; constructor ( db , migrationsBuilder = new Migrations ( ) ) { this . db = db ; this . migrationsBuilder = migrationsBuilder ; } applyMigrations ( ) { this . applyMigrationsPack ( this . migrationsBuilder . initial ) ; this . migrationsBuilder . dateSorted . forEach ( migrationsPack => { this . applyMigrationsPack ( migrationsPack ) ; } ) ; } applyMigrationsPack ( migrationsPack ) { migrationsPack . forEach ( migration => { migration ( this . db ) ; } ) ; } }