import { Knex } from 'knex'; export default class Migrate { protected dbConnection: Knex; protected migrationsPath: string; /** * Constructor */ constructor(); /** * Create migrations table if needed */ createMigrationsTableIfNeeded(): Promise; /** * Run the database migrations */ run(): Promise; /** * Rollback the last database migration */ rollback(): Promise; /** * Show rollback migrations */ printRollbackMigrations(): Promise; /** * Drop all tables and re-run all migrations */ fresh(): Promise; /** * Drop every given table regardless of the foreign keys between them * * Dropping table by table only works for a schema without relations, because a parent table * cannot be dropped while a child still references it and the drop order is not known here. */ private dropAllTables; /** * Get all tables from database */ private getAllTables; }