Improve the migration and seeder flow
@balazsnasz
For now, migrations/seeders are not tracked properly if they have ran or not. Especially, if we call new migrations/seeders in the upgrader_post_install, we must know somehow which ones have already ran and which isn't. For WordPress, traditional migrations doesn't make sense in my opinion.
Here is my concern: if you create new migrations and/or seeder, you will most likely add columns or new data for an existing table. Now, the runOnce selects a count() for checking if it has already ran or not. If you add new columns or new lines to an existing table, the new migrations/seeders won't run due to this.
I have two possible solutions in my mind. Attach the plugin's current version to each migration/seeder files. This way you know which files are new (in the upgrader_post_install hook) and you can run them. For example, create-websites-table-1.4.7.php. Store every migrations/seeders' state in a new {plugin-name}-migrations table. This is closer what Laravel does. The first solution is easier to implement. However the second one is more flexible, but for WordPress it also seems kinda overkill.