rickbergfalk / postgrator

A PostgreSQL, MySQL, and SQL Server migration tool using plain sql scripts.
MIT License
449 stars 70 forks source link

Fix typings for `getDatabaseVersion` #144

Closed bajtos closed 2 years ago

bajtos commented 2 years ago

The function returns undefined when no migrations were applied yet.

This is a follow-up for https://github.com/rickbergfalk/postgrator/pull/142.

bajtos commented 2 years ago

I am actually not sure if this is a good fix. When schemaversion table exists and is empty, getDatabaseVersion() returns 0.

Let's discuss what's the right solution here: https://github.com/rickbergfalk/postgrator/issues/139#issuecomment-1047630285

rickbergfalk commented 2 years ago

Closing this since we're going with 0 as you suggest!