Replies: 1 comment
-
You don't need to do set connection on every migration and seeder like that. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am writing here and hope someone can somehow explain this to me.
I have a lot of migrations and seeds and on every seed I use the DB::connection('con2'), so that the right Table can be seeded.
On the first run with
php artisan migrate --seed
everything works as expected.On all runs after that only
php artisan migrate:refresh --seed
will work.If I run
php artisan migrate:fresh --seed
I get presented that the table is already available.Even if I do a dump with
php artisan schema:dump
I see that there is only the tables of the first / standard connection.Maybe I am missing something, but this is really a pain to work with..
config\database.php:
Migration:
Seeder:
Beta Was this translation helpful? Give feedback.
All reactions