-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
artisan db:seed does not work and does not print an error, if you want to insert multiple rows with different amount of key-value pairs #2198
Comments
you are doing something wrong and have given nothing to go on to help you. This belongs on the forums, not a bug. As I have done it many times before and so have a lot of other people. |
Well, it actually is a bug but don't expect a fix for this, as it would get messy and an easy solution is to just use the same array structure everywhere (declare the same keys, possibly by using |
I don't see the bug, doesn't help that the report is just showing some basic array. Because what he shows I am sure I have done before. |
Inserts are done in batch when you do this so, short of creating batches based on parameters being identical, this isn't a bug so much as how the Bulk inserts are performed. |
Sry, may I did not provide enough information. I will update my first post. Please let me know if something isn't clear to you. |
What database are you using out of curiosity? Because MySQL threw an error for me. |
I'm using MySQL too. Behaviour in detail: [Exception] Invalid parameter number:
Database seeded! (Actually NO data was inserted):
|
Yup. It only throws the exception when you've got less items in the arrays that are running later. |
Yeah you need to have the same columns in each row. |
there is no problem , you have to register your seeder in DatabaseSeeder.php inside app/database/seed folder : add this line in DatabaseSeeder.php |
Actually they haven't any default value for "position" that's why. |
wtf stop commenting this is from 2013 |
artisan db:seed does not work and throws no error, if you provide an array like this one. On the command line you just get this message: "Database seeded!"
The bug is not that such an INSERT does not work, but you get NO ERROR MESSAGE. So someone assume that the database-insert does work and searches hours for the problem...
The table structure:
The SEED array:
The artisan commands:
php artisan migrate
php artisan db:seed
The text was updated successfully, but these errors were encountered: