phinx icon indicating copy to clipboard operation
phinx copied to clipboard

Add more handy functions to AdapterInterface

Open flangofas opened this issue 5 years ago • 3 comments

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();

flangofas avatar Mar 27 '20 12:03 flangofas

What would be the use case for the first and last? Do you want to stub out a PR here?

dereuromark avatar Apr 11 '20 06:04 dereuromark

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.

flangofas avatar Apr 13 '20 19:04 flangofas

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.

MasterOdin avatar Apr 14 '20 03:04 MasterOdin