I would like change sql user privilages on production environment (revoke alter privilages) but if I will change privileges, migration command will not work properly because user does not have alter privilages. There is any method for run migration under different user?
@kmjadeja This seems like the most practical solution. I typically use an underprivileged user for normal application database access. And then have a privileged user for situations that require it.
That way you won't need to use the --database parameter for artisan migrate.
It also allows you to pick and choose which user (connection) you need for any give migration.
This is especially useful when using multiple databases in an application.
Update: I found that setting the connection property in the migration files breaks testing since the property apparently overrides any test settings. So my suggestion does not work.