The CREATE TABLE IF NOT EXISTS yields more locks than checking if the table exists using a SELECT first before running CREATE TABLE.
This makes more sense as the table usually already exists, so we optimize for the happy path.
In a NodeJS environment it will just work as before, but in a Bun environment it will make the "forced exit" error message disappear and remove the 10 s waiting period when migrations are done.
* feat(types): move Emigrate types to separate package
Also refactor the types to use discriminating unions for easier error handling and such.
Errors passed to storage plugins should now be serialized and storage plugins are expected to return already serialized errors on failed history entries.
* fix(mysql): handle the new type changes
* fix(storage-fs): handle the new type changes
* feat(cli): better error handling and types
Adapt to the new types from the @emigrate/types package, like discriminating union types and serializing and deserializing errors