8000 [Bug] Migration doesn't respect current environment · Issue #67 · laravel/framework · GitHub
[go: up one dir, main page]

Skip to content

[Bug] Migration doesn't respect current environment #67

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

Closed
jackmcdade opened this issue Jan 16, 2013 · 12 comments
Closed

[Bug] Migration doesn't respect current environment #67

jackmcdade opened this issue Jan 8000 16, 2013 · 12 comments

Comments

@jackmcdade
Copy link

Correct me if i'm wrong, but shouldn't the migrate command respect the current environment? I need to add the --env=local flag every time i run a migration.

@jasonlewis
Copy link
Contributor

I think that's expected behavior. Could be wrong though.

@niallobrien
Copy link

I just ran into this issue too and it is a little annoying.
Perhaps it would be better if there was a default environment config option somewhere...?

@jackmcdade
Copy link
Author

Seems strange to be a default behavior if i've got through the trouble (well, not that much trouble) of creating an environment rule and overriding configs. I would naturally expect commands to respect that.

@niallobrien
Copy link

@jackmcdade Well, it's not something that's currently configurable through local config files, but perhaps it should be?
Then we could just specify --env=prod when we want.

@jackmcdade
Copy link
Author

You could "hack" the detectConsoleEnvironment() method in `vendor/laravel/framework/src/Illuminate/Foundation/Application.php' to return your desired environment, and pull it out later. I hate that kind of stuff though.

@franzliedke
Copy link
Contributor

Can't you just set a global environment variable LARAVEL_ENV in your operating system? After all, you're always going to be in development mode on your local machine.

@jackmcdade
Copy link
Author

The console is explicitly looking for "--env=" in your command to look for an environment, else it's always production. No other conditions are present.

@niallobrien
Copy link

@jackmcdade Any nice way to overload that method for local development?

@franzliedke
Copy link
Contributor

Then I'd suggest falling back to an environment variable first. So that would be first --env option, then LARAVEL_ENV environment variable and lastly production.

@taylorotwell
Copy link
Member

How did you specify the environment in the start file? Did you use a machine name?

@jackmcdade
Copy link
Author

Yes, machine name in the start file.

@taylorotwell
Copy link
Member

This is fixed. Thanks!

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

No branches or pull requests

5 participants
0