0

I have successfully created a database 'translations' table using artisan migration. When this database is released into a production environment, I will start getting translation text files for new translation content. They are formatted as SQL inserts files.

I know artisan migration has seeding tools, however everything I've reviewed indicates that seeding should be used for testing & fake development content. I have not seen any example of using migrate seeding for production 'LIVE' data.

My question is this; Is there a Laravel method for deploying live database data? Whether it uses artisan migrate or some other Laravel tool. As it is now, I plan on loading these translation SQL files directly into the DB without Laravel.

Manually running the .SQL file from within the database work correctly, however I'm trying to determine if there is a Laravel method for this?

Chris
  • 33
  • 4

1 Answers1

1

There's nothing stopping you from using the Seeder to load production data, as long as you can manage it correctly. Generally, you should only call php artisan db:seed once, usually in tandem with php artisan migrate. However, you can omit specific seed files from being called by php artisan db:seed, and if you want to call them later, simply do:

php artisan db:seed --class="WhateverSeeder"

The only difficulty I can see is either converting your .SQL files to the correct syntax for a Laravel Seed, or just getting the Seed file to insert the data correctly. But, if you can get around those hurdles, you should be fine.

Everything on seeding can be found at https://laravel.com/docs/5.8/seeding

Tim Lewis
  • 27,813
  • 13
  • 73
  • 102