You can use a seeder class for this.
How would you go about populating a table with 2m+ rows on deployment? (Best Practices)
I am trying to find if there is any better way to populate tables that have lots of rows of data then simply importing a CSV manually.
How would you go about doing this? Note that this is only done on deployment which only happens once for each instance of the application, which happens maybe once every 6 months if not more rarely.
I don't find it problematic to manually import the data into the relevant tables. I am simply looking to see what is considered to be the best practice regarding this kind of tasks in deployment.
I wouldn't do it through PHP at all, to remove the slow down that will occur with PHP holding all the data and processing it. The best choice here would be to delegate it to actual MySQL (or whatever SQL service you use).
Please or to participate in this conversation.