B
B
BonBon Slick2016-11-01 00:17:06
MySQL
BonBon Slick, 2016-11-01 00:17:06

Backtrace error in MySQL after make:migration Laravel 5.3?

In general, everything is fine with the migration, if you click Ignore All , it will display all the fields as it should. Here is the error code:

<b>Some errors have been detected on the server!
Please look at the bottom of this window.</b>
Notice in .\libraries\dbi\DBIMysqli.class.php#519
 Undefined offset: 245

Backtrace

.\libraries\DatabaseInterface.class.php#2731: PMA_DBI_Mysqli->getFieldsMeta(object)
.\libraries\sql.lib.php#1927: PMA_DatabaseInterface->getFieldsMeta(object)
.\libraries\sql.lib.php#2245: PMA_getQueryResponseForResultsReturned(
object,
array,
string 'lara53',
string 'products',
NULL,
NULL,
object,
string './themes/original/img/',
string '100',
integer 50,
string 'SELECT * FROM `products` LIMIT 0, 50 ',
NULL,
NULL,
NULL,
NULL,
NULL,
string 'SELECT * FROM `products`',
NULL,
)
....

Here is the migration code
Schema::create('products', function (Blueprint $table) {
            $table->increments('product_id')->unsigned();
            $table->string('product_name', 100);
            $table->string('product_slug')->nullable();
            $table->integer('category_id')->unsigned()->nullable();
            $table->double('price', 10, 2)->nullable();
            $table->double('whole_sale_price', 10, 2)->nullable();
            $table->integer('whole_sale_price_starts_from')->nullable();
            $table->string('bar_code', 25)->unique();
            $table->integer('stock')->nullable();
            $table->boolean('status')->default(0);
            $table->string('description', 500)->nullable();
            $table->string('brand', 25)->nullable();
            $table->integer('weight')->nullable();
            $table->json('color')->nullable();
            $table->string('size')->nullable();
            $table->json('tags')->nullable();
            $table->string('rating_general')->nullable();
            $table->json('ratings_counter')->nullable();
            $table->string('sales_counter')->nullable();
            $table->string('views_counter')->nullable();
            $table->string('avatar_url')->nullable();
            $table->json('pics_urls')->nullable();
            $table->timestamps();
         });

Here is the factory code
$factory->define(App\Product::class, function (Faker\Generator $faker)
{
 
  return [
  'product_name' =>  $faker->unique()->catchPhrase,
  'price' => mt_rand( 100, 999 ),
  'bar_code' => str_random( 25 ),
  'stock' => mt_rand( 1, 100 ),
  'whole_sale_price' => mt_rand( 10, 100 ),
  'whole_sale_price_starts_from' => mt_rand( 10, 100 ),
  'status' => mt_rand( 0, 1 ),
  'description' => $faker->text(500),
  'brand' => $faker->randomElement(['Russian', 'Ukrainian', 'Franch', 'Germanian', 'Turkish', 'Egyptian']),
  'weight' => mt_rand( 1, 100 ),
  'size' =>  $faker->numberBetween(1, 30).' X '. $faker->numberBetween(1, 30).' X '. $faker->numberBetween(1, 30). $faker->randomElement(['m', 'mm', 'cm']),
  'tags' => json_encode($faker->word.','.$faker->word.','.$faker->word),
  'avatar_url' => '/img/'.$faker->numberBetween(1, 330).'.jpg',
  'rating_general' => mt_rand(0, 5),
  'ratings_counter' => json_encode([
  		mt_rand(0, 5),
    mt_rand(0, 5),
    mt_rand(0, 5),
    mt_rand(0, 5),
    mt_rand(0, 5),
 		]),
  'sales_counter' => mt_rand(0, 100),
  'views_counter' => mt_rand(0, 10000),
  'pics_urls' => json_encode([
    'images' => [
    '/img/'.$faker->numberBetween(1, 330).'.jpg',
    'img/'.$faker->numberBetween(1, 330).'.jpg',
    '/img/'.$faker->numberBetween(1, 330).'.jpg',
    'img/'.$faker->numberBetween(1, 330).'.jpg',
    '/img/'.$faker->numberBetween(1, 330).'.jpg',
    ]
    ]),
  'color' => json_encode([
    $faker->safeColorName,
    $faker->safeColorName,
    $faker->safeColorName,
    ]),
  'created_at' => $faker->dateTime( $max = 'now')
  ];
});

I understand that it then displays all the buzz there, I don’t understand what harm except alert 'and it does, this error and how to remove it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question