-
-
Notifications
You must be signed in to change notification settings - Fork 519
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
Create database on initial migration? #1757
Comments
There is
Never used rails, so please actually describe what you want to propose, as this has no meaning to me :P But both of that sounds like they work more like schema generator rather than migrations (and we already have that). |
Good point on conflating db creation + migration that could be a little confusing. Saying that, tying that action specifically to schema creation also feels disconnected... In rails land For now I'll experiment with creating a helper using |
This sounds more like you want the schema to be generated too, otherwise you will have just clear db. If so, then again, schema generator is the way to go and it already supports creating db automatically ( |
Not quite- in this case we'll have the migrations so the flow would be:
|
I think we could just create the db right ahead, just like we do in the schema generator. Looking at the code and But I still see a value in having the separate command to create the db. PR welcome, not a big priority but if nobody will pick this up, will do so myself before v5 is out. |
This command ensures the database exists. Related: #1757
Is your feature request related to a problem? Please describe.
In trying to setup a new database from an initial migration I realized there's no way to create a new database from scratch. Is that accurate?
Describe the solution you'd like
Something akin to
rake db:init
orrake db:create
where mikro-orm will take the runtime config and create a new database if it doesn't existDescribe alternatives you've considered
Tried creating a migration to do this but mikro-orm migrator fails to initialize because the database doesn't exist. It looks like similar functionality is provided by the schema generator but that's using a lower level connection.
The text was updated successfully, but these errors were encountered: