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

Migration problem when using custom modules path #23

Closed
marijo465 opened this issue Aug 20, 2014 · 2 comments · Fixed by #26
Closed

Migration problem when using custom modules path #23

marijo465 opened this issue Aug 20, 2014 · 2 comments · Fixed by #26

Comments

@marijo465
Copy link

For my project i wanted to place the modules inside the app folder.
I changed the paths config to:

return [
    'modules'   =>  base_path('app/modules'),
    'assets'    =>  public_path('modules'),
];

Everything worked fine except the migrations. I would get "nothing to migrate" message.
After looking in the code i found that in ModuleMigrateCommand this path function is used:

protected function getMigrationPath($name)
{
return basename($this->module->getPath()) . "/{$name}/database/migrations/";
}

This ofcourse returns:"modules/[Modulename]/database/migrations/"
And this command would be executed: "php artisan migrate --path="modules/[Modulename]/database/migrations/"" Which searches for migrations in a folder that does not exist.

I have currently fixed it with the following code until this issue is resolved.

protected function getMigrationPath($name)
{
$modulePathWithoutBasePath = str_replace(base_path(), "", $this->module->getPath());
return $modulePathWithoutBasePath . "/{$name}/database/migrations/";
}
@gravitano
Copy link
Member

Thank you for telling me, I will fix it immediately.

@morilog
Copy link

morilog commented Aug 23, 2014

I have same problem too.

@gravitano gravitano mentioned this issue Aug 24, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants