Despite this ticket: #20 being marked as closed, I'm still experiencing this problem with the latest version.
As it exists now, the createMigrationsTable function in the pg driver has ifNotExists: false, which I assume is because pg doesn't support IF NOT EXISTS create statements. This results in the migrations table getting recreated each time the migrations are run, which results in a crash after the first run.
This change fixes the issue by querying the information_schema.tables table to check for the existence of a migrations table. If it exists, the creation of the table is skipped.
The postgres driver blindly creates the migrations table regardless o…
…f whether or not it's already been created - this change to the driver first checks the information schema for the existence of the table and does/doesn't create it accordingly