public function removeTable(Table $table) { /* It's important that we drop all CONSTRAINTs first, so we iterate the columns and save them without a reference (triggers saveColumn()) */ /* We also need to drop all CONSTRAINTs, that reference THIS table. This will take a lot of performance right now */ //TODO: OPTIMIZE PERFORMANCE!!! foreach ($table->getColumns()->loadAll() as $col) { $this->dropConstraint($col); $this->dropForeignConstraints($col); } $name = $this->quoteName($table->getDatabase(), $table); $this->query("DROP TABLE {$name}"); return $this; }