迁移类很棒但是如果你有10k记录怎么办?

In the back-end of web of things, I've been recently introduced to the use of migration classes, and how you can use them as sort of version controlling for your schema structures etc.. It seems that, in implementing the up(); function which is the data rebuilding mechanism within migration class, you basically not only create tables but also re-insert each and every record to these tables.. it's great and i see it truly giving me version controlling in terms of keeping the structure of tables in sync..only that I can't help but keep wondering how it's efficient when/if you have a table that has thousands of records? Do you have to write and hand-code insert query for each record? Is there a feature i'm missing in migrations that automagically does it for me?

Thanks

You may use this package Laravel Inverse Seed Generator. It can generate new seed based on existing data in database table.

Laravel Inverse Seed Generator

Another option you can seed the data from CSV file but you must modify BaseSeeder class to include a function seed from CSV.

Refer here

Seeing from CSV file