-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(mysql): try creating database if not exist #21
Comments
I'm not convinced of the value of migrate creating the DB is worth the cost but think this is an issue worth discussing. I see the following issues with
The value I see is:
|
Thanks for your thoughts! The permissions point is something I hadn't thought about much as I am accustomed to thinking about access control defined by the application rather than in the database. I think it's just an easier development process to have db schema changes (including db creation) organized around one tool. But I do see the fine line here about db creation being out of scope for Currently, I create a database with a Dockerfile which just has a single COPY instruction to move |
I'd be interested in having this feature for postgres as well. The reason is mig.Drop doesn't work for databases that have functions, triggers and the like. It only drops the tables and if you have interdependencies in your database code. It doesn't work. This makes it impossible to perform unit tests starting with a clean slate base for every unit test. With postgres, I've been forced to execute a query killing all open connections before the test, drop the test table if it exists, and then re-create it. |
@murphybytes Do your up migrations which add the functions and triggers have corresponding down migrations which drop the functions and triggers? |
refer to: mattes/migrate#279
I created an issue for this because I'm interested in having this feature. Thoughts?
The text was updated successfully, but these errors were encountered: