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

Namespace accident #194

Open
AdnanHussainTurki opened this issue Oct 24, 2019 · 2 comments
Open

Namespace accident #194

AdnanHussainTurki opened this issue Oct 24, 2019 · 2 comments

Comments

@AdnanHussainTurki
Copy link

I have two connections having the same table names say:

connection: mysql has a table called products
connection: inventory has a table called products

when I generate migrations for both connections both of them lies on the same folder database/migrations with the same class name which causes this error:
Cannot declare class CreateProductsTable, because the name is already in use.

Kindly guide me a quick fix.

@djunehor
Copy link

djunehor commented Nov 6, 2019

Generate migrations for the second connection in a separate folder i.e
php artisan migrate:generate --path=database/migrations/mysql.
php artisan migrate:generate --path=database/migrations/inventory

Don't forget to create the mysql and inventory folders first before running the command.

You can then migrate with:
php artisan migrate --path=database/migrations/mysql --connection=msql
php artisan migrate --path=database/migrations/inventory --connection=inventory

@AdnanHussainTurki
Copy link
Author

Great Call, djunehor. Thanks. Will remember it.

By the way, Xenthron please add some flag to add to remind it or make folder automatically for different connections.

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

2 participants