phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Seeder Log and Prevent/Allow duplicate execution

Open claude-eric-steiner opened this issue 6 years ago • 1 comments

Hi there, maybe I didn't get something, but here my thoughts worth 5 cents:

Execution of Migrations Scripts are logged into phinxlog, and can be queried from command line with "phinx status". So track of execution is easy and duplicate execution is prevented. A really great thing!

I'm missing a bit that kind of control for the the seeders... I'm not a phinx crack, and to be honest, this tool is quite new for me, so maybe I'm missing somehting here (but couldn't find it in the docs).

Would it not be great to have also a log (and the possibility to query it with a status command from command line) for the seed executions? Also it would be quite handy to have a property inside the seeder class to prevent or allow duplicate executions.

Of course you could add this functionallity into the each seeder itself (to write some stuff about its execution into a log table, and then later query that table to check if it was already executed), but I feel like a generic approach without a homebrew hack for this would be better...

any thoughts?

claude-eric-steiner avatar May 05 '20 10:05 claude-eric-steiner

I am currently building seed tracking in Migrations: https://github.com/cakephp/migrations/pull/939 It could be a possible improvement for phinx as well.

They can also be marked as idempotent, if rerunning multiple times is fine or even expected (internal updates).

dereuromark avatar Nov 03 '25 15:11 dereuromark