Reputation: 1820
I basically want to create a custom doctrine task that truncates data in all the tables. I was trying this approach by getting the active Doctrine connection, and executing custom SQL statements that truncate the tables. After I finally got the connection, I got a fatal error stating PDO::execute()
is an undefined method. Do I need to include a file?
Code:
$connection = $databaseManager->getDatabase('doctrine');
$st = $connection->execute("...............");
Thanks
Upvotes: 1
Views: 889
Reputation: 1820
Alternative is to the drop the DB each time:
> symfony doctrine:build-sql
> symfony doctrine:drop-db
> symfony doctrine:insert-sql
Source: How to make 'symfony doctrine:build-sql' task generate 'DROP' statments?
Upvotes: 0