C
C
chamav2016-07-17 20:24:05
Laravel
chamav, 2016-07-17 20:24:05

How to populate a database in Laravel 5 with directories?

There is Laravel 5.2 .
There are various directories in the old database
. I migrated all tables and fields to laravel migration.
Tell me how to export all the necessary data to seeds, so that when migrating the database, all directories are imported into the database.
Those. Interested in what would be created during the migration directories (which has already been done), then they are filled with data.
php artisan migrate

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Kondratiev, 2016-07-17
@inik23

I think these links should point you in the right direction.
link1
link2

C
chamav, 2016-07-17
@chamav

In the examples given, we are mainly talking about migrating the structure of tables, and there are only two options for loading data:

public function up()
{
    $path = 'path_to_sql/dump.sql';
    DB::unprepared(file_get_contents($path));
}

And a link to the service laravel.stonelab.ch/sql-seeder-converter , which unfortunately does not work.
Now I’m just transferring the MySql database to laravel so that later I can roll it through migrations to the PostgreSql database

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question