coreui-free-laravel-admin-template icon indicating copy to clipboard operation
coreui-free-laravel-admin-template copied to clipboard

Error on Seeders

Open pablozagni opened this issue 5 years ago • 3 comments

runing php artisan migrate:refresh --seed I get SQLSTATE[22001]: String data, right truncated: 1406 Data too long for column 'description' at row 1 (SQL: insert into example (name, description, status_id) values (Velit architecto voluptates quam et., Qui voluptatibus possimus tenetur et sapiente esse distinctio. Alias est est ipsam dicta praesentium. Ducimus perspiciatis aut enim nobis suscipit enim ducimus. Consequatur ipsa sit nulla exercitationem reiciendis qui placeat. Voluptatum consequatur molestias ex voluptatem., 4))

I've fixed it changing \database\seeds\ExampleSeeder.php 'description' => $faker->paragraph(3,true), to 'description' => $faker->paragraph(2,true),

Thanks!

pablozagni avatar May 06 '20 22:05 pablozagni

1406 Data too long for column 'description'

That error is telling you that you're trying to put too much data into a column.

For example, if the data type for the description column is a varchar (which has max length of 255) and you are trying to put 300 characters in that column, it will throw that error.

What is the column/data type for the description column?

marchershey avatar May 09 '20 06:05 marchershey

Yes! Seeder is Generating 3 paragraph. The resoult is bigger than descriptin sice (I don´t remember your field definition) You should modify Seeder to fill the field with a smaller faker, like 2 paragraph ;-) Greets!

pablozagni avatar May 09 '20 13:05 pablozagni

Make it to paragraph(2,true) for testing

nguyenducmy1993 avatar Aug 11 '20 17:08 nguyenducmy1993