I get an error "Class does not exist" when trying to populate my DB by executing
"php artisan seed:db".
UserMoviesSeeder.php in the folder database/seeds has the following content:
<?php
use Illuminate\Database\Seeder;
use App\Project;
use App\UserMovie;
use App\User;
class UserMoviesSeeder extends Seeder
{
public function run()
{
$this->call(ProjectsTableSeeder::class);
}
}
class ProjectsTableSeeder extends Seeder {
public function run()
{
DB::table('user_movies')->delete();
DB::disableQueryLog();
UserMovie::create([
'user_id' => 1734805,
'tmdb_id' => 100,
'ratio' => 4
]);
UserMovie::create([
'user_id' => 716091,
'tmdb_id' => 100,
'ratio' => 4
]);
// ... and so on
}
}
I run the command:
php artisan db:seed --class=UserMoviesSeeder
And I get an error:
In Container.php line 752:
Class UserMoviesSeeder does not exist
I tried the following:
composer dump-autoload
It returns:
VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.
VirtualAlloc() failed: [0x00000008] ������������ ������ ��� ��������� �������.
If I rename both, the file and the class to standard name "DatabaseSeeder" and run the command:
php artisan db:seed
Then I have an error:
Out of memory (allocated 547356672) (tried to allocate 1073741824 bytes)
I assume that 547356672 is the size of my seeder file (it is about 5.5Gb).
But why it tries to allocate twice more 1073741824 ?
I have only 8Gb of RAM, so it can't allocate 10Gb.
Previously I had 10Gb seeder in this folder, but now I have just one seeder file of 5.5Gb there.
-
what is the file size of your seeder?Ben– Ben2018年04月01日 07:37:24 +00:00Commented Apr 1, 2018 at 7:37
-
seeder is about 5.5GbВиталий Комаров– Виталий Комаров2018年04月02日 15:04:19 +00:00Commented Apr 2, 2018 at 15:04
-
the file is too large, try to import through command or import it batch by batchBen– Ben2018年04月02日 16:42:21 +00:00Commented Apr 2, 2018 at 16:42
-
"batch by batch" will take a huge amount of time, but what do you mean by "import through command"?Виталий Комаров– Виталий Комаров2018年04月03日 14:15:07 +00:00Commented Apr 3, 2018 at 14:15
-
insert batch by batch (stackoverflow.com/questions/6889065/…), insert through command (stackoverflow.com/questions/4546778/…)Ben– Ben2018年04月03日 14:42:52 +00:00Commented Apr 3, 2018 at 14:42