phinx
phinx copied to clipboard
Add more handy functions to AdapterInterface
Would you guys want to add the following (or some) methods to the AdapterInterface?
# Within a Seeder:
$this->getAdapter()->getAllTables();
$this->getAdapter()->disableForeignKeyConstraint();
$this->getAdapter()->enableForeignKeyConstraint();
$this->getAdapter()->truncateAllTables();
What would be the use case for the first and last? Do you want to stub out a PR here?
What would be the use case for the first and last?
The idea is to refresh the database before seeding. Ideally, this should be provided by command so I've made a little workaround and have done it in a seeder.
Do you want to stub out a PR here?
Sure, why not.
I would love to see the middle two as I think they are invaluable for seeders that deal with complex data and I had a use-case for them the other day. I would greatly appreciate seeing at least a PR with those two on their own, with the other two in their own, allowing for a philosophical discussion not holding up the foreign key stuff.