danielgindi / knex-schema-builder

A schema builder module for knex.js, handles schema initialization and migration

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unexpected token in schema.json is reported as 'empty-database'

yeya opened this issue · comments

commented

When schema.json file contains invalid json, the upgrade process ignore the error because originalVersion === undefined here and throw empty-database error instead.

  • Steps to reproduce:
    Run DB Upgrade with schema.json contains invalid JSON, for example: { "schema": "wrong", }
  • Expected Result:
    throw SyntaxError: Unexpected token } in JSON at position X
  • Actual Result:
    throw empty-database

Please test with 0.4.5 ;-)

commented