#3441·knex

Calling migrate.status() on new DB fails, but calling migrate.currentVersion() first works

Author: utillityCreated Sep 14, 2019Updated Sep 23, 2026
LabelsNG_bug

Environment

Knex version: 0.19.4 Database + version: mssql 14.0.2027.2 OS: Windows 10 x64, VSCode @smorey2

Bug

  1. Explain what kind of behaviour you are getting and how you think it should do upon connecting to the DB, I want to check, if I have to update it (migration). So I execute const curStatus = await db.migrate.status();

  2. Error message Crashes with SQL error, that migrations table does not exist

  3. Workaround If I first call await db.migrate.currentVersion();, this seems to create the missing migrations table and then .status() can also be called without failing.

regards, Tilli