Skip to content
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 model and migration on the same command #427

Closed
1 task
alfonsocv12 opened this issue Mar 26, 2021 · 2 comments · Fixed by #492
Closed
1 task

Create model and migration on the same command #427

alfonsocv12 opened this issue Mar 26, 2021 · 2 comments · Fixed by #492
Labels
enhancement A feature that exists, works as intended but needs to be improved

Comments

@alfonsocv12
Copy link
Contributor

Describe the feature as you'd like to see it

On the orator orm, I was used to create my model and migration add the same time with this command

orator make:model Foo -m

What do we currently have to do now?
You have to use 2 commands like this

masonite-orm model Foo
masonite-orm migration Foo --create

Additional context

I believe the best way to implement this is defaulting the migration --create, most times when you create a new model you create a table.

But leaving the possibility to change for --table like this

masonite-orm model Foo -m --table

  • Is this a breaking change?
@alfonsocv12 alfonsocv12 added the enhancement A feature that exists, works as intended but needs to be improved label Mar 26, 2021
@josephmancuso
Copy link
Member

Something to keep in mind as well is that some people have migrations in a different directory. Especially when not using Masonite so we will have to pass the -d flag off as well to the migration command

@Marlysson
Copy link
Contributor

But how we can distinguish -d of models directory from -d of migrations directory? Renaming it maybe?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A feature that exists, works as intended but needs to be improved
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants