You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 28, 2018. It is now read-only.
Migrate does not seem to close the database after running migrations.
Might not be issue for most usage, but in my case, it is, as I am trying to use temporary databases for testing that are destroyed afterwards. Right now, I can't do this, because dropping a database with open connections to it is... tricky.
I think this could be done with Driver having a Close (Cleanup, ...?) method that would be called after migrations by Up, Down, etc.
The text was updated successfully, but these errors were encountered:
Sorry for my late reply. I was on vacation last week.
Migrate does not seem to close the database after running migrations.
Ah, good point. I see two options:
Remove Initialize(url string) error and move all logic from there to Migrate(file file.File, pipe chan interface{}). This means, for every migration file that get's applied, it would open (and close) a connection.
Keep Initialize(url string) error and add Close() error which handles all DB connection closing, once all migration files are applied.
I like option 1 more but not sure about the opening/ closing overhead. What do you think?
Migrate does not seem to close the database after running migrations.
Might not be issue for most usage, but in my case, it is, as I am trying to use temporary databases for testing that are destroyed afterwards. Right now, I can't do this, because dropping a database with open connections to it is... tricky.
I think this could be done with Driver having a Close (Cleanup, ...?) method that would be called after migrations by Up, Down, etc.
The text was updated successfully, but these errors were encountered: