Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
yeya opened this issue Aug 12, 2020 · 2 comments · Fixed by #10
Closed

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

yeya opened this issue Aug 12, 2020 · 2 comments · Fixed by #10

Comments

@yeya
Copy link
Contributor

yeya commented Aug 12, 2020

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
@danielgindi
Copy link
Owner

Please test with 0.4.5 ;-)

@yeya
Copy link
Contributor Author

yeya commented Aug 16, 2020 via email

yeya added a commit to yeya/knex-schema-builder that referenced this issue Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants