import "reflect-metadata";
import {createTestingConnections, closeTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
import {Connection} from "../../../../src/connection/Connection";

describe("migrations > show command", () => {
    let connections: Connection[];
    before(async () => connections = await createTestingConnections({
        migrations: [__dirname + "/migration/*.js"],
        enabledDrivers: ["mysql", "mariadb", "oracle", "mssql", "sqljs", "sqlite", "postgres"],
        schemaCreate: true,
        dropSchema: true,
    }));
    beforeEach(() => reloadTestingDatabases(connections));
    after(() => closeTestingConnections(connections));

    it("can recognise pending migrations", () => Promise.all(connections.map(async connection => {
        const migrations = await connection.showMigrations();
        migrations.should.be.equal(true);
    })));

    it("can recognise no pending migrations", () => Promise.all(connections.map(async connection => {
        await connection.runMigrations();
        const migrations = await connection.showMigrations();
        migrations.should.be.equal(false);
    })));
 });

import "reflect-metadata";
import {createTestingConnections, closeTestingConnections, reloadTestingDatabases} from "../../../utils/test-utils";
import {Connection} from "../../../../src/connection/Connection";

describe("migrations > show command", () => {
    let connections: Connection[];
    before(async () => connections = await createTestingConnections({
        migrations: [__dirname + "/migration/*.js"],
        enabledDrivers: ["postgres"],
        schemaCreate: true,
        dropSchema: true,
    }));
    beforeEach(() => reloadTestingDatabases(connections));
    after(() => closeTestingConnections(connections));

    it("can recognise pending migrations", () => Promise.all(connections.map(async connection => {
        const migrations = await connection.showMigrations();
        migrations.should.be.equal(true);
    })));

    it("can recognise no pending migrations", () => Promise.all(connections.map(async connection => {
        await connection.runMigrations();
        const migrations = await connection.showMigrations();
        migrations.should.be.equal(false);
    })));
 });

Revert "enable test for all db drivers"
Revert "enable test for all db drivers"

This reverts commit ff505cc98c93bb2132571ce23f86af116f8ea43a.
