예제 #1
0
 /**
  * {@inheritdoc}
  */
 public function execute()
 {
     $getTablesCommand = new GetTablesCommand();
     $getTablesCommand->setConnection($this->connection);
     $tables = $getTablesCommand->execute();
     $this->preExecute();
     foreach ($tables as $table) {
         $dropTable = new DropTableCommand();
         $dropTable->setTable($table)->cascade()->setConnection($this->connection)->setEventDispatcher($this->dispatcher);
         $this->sql .= $dropTable->getSql();
         $dropTable->execute();
     }
     $this->postExecute();
     return true;
 }
예제 #2
0
 public function testGetSql()
 {
     $createTableCommand = new DropTableCommand();
     $createTableCommand->setTable(new Table('foo'));
     $this->assertEquals('DROP TABLE public.foo;', $createTableCommand->getSql());
 }