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

Migrations in the old way #58

Open
atefrihane opened this issue Oct 10, 2020 · 5 comments
Open

Migrations in the old way #58

atefrihane opened this issue Oct 10, 2020 · 5 comments

Comments

@atefrihane
Copy link

atefrihane commented Oct 10, 2020

Hey guys

How can I generate migrations in the standard way like in the previous versions ?
I've played around with config files but no way

UPDATE :

I had to edit this method here in MigrateMakeCommand Class

 protected function getMigrationPath()
    {
       
        $migrationPath = $this->laravel['path'] .'/' . $this->getConfiguredFolder('migrations');
   
        if (! is_null($targetPath = $this->input->getOption('path'))) {
            return $migrationPath . '/' . $targetPath;
        }

        return $migrationPath;
    }

is there a cleaner way to make this change ?

@Artem-Schander
Copy link
Collaborator

Hi @atefrihane,

If I understand correctly, you could use Laravels make method.
Like: php artisan make:migration --create=some_table create_some_table

I hope this helps. Otherwise feel free to reopen this issue.

@atefrihane
Copy link
Author

@Artem-Schander Yes I know I can do that manually with the make migration command..
but what I meant is to generate it automatically in app/database folder like ( in <= 1.4 version)..
Thank you for your answer anyway

@Artem-Schander
Copy link
Collaborator

What do you mean by "automatically"?
In both scenarios you have to execute an artisan command, either make:migration or make:module:migration.
Or am I missing something here?

@atefrihane
Copy link
Author

atefrihane commented Oct 11, 2020

@Artem-Schander
what I meant is when I executemake:module ModuleName in the old versions it creates a ModuleName folder + migration file in app/database ( the standard laravel database folder)..
For the current version when you set migration=>true in config file , the migration gets created inside the module folder itself..
That's why I was asking if I can do it in the old way..
I hope it's clear!

@Artem-Schander
Copy link
Collaborator

Ah, now I got it.
Not my brightest moment ^^
I'll see what I can do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants