/** * @param CreateTable $schema * * @return array */ public function create(CreateTable $schema) { $sql = 'CREATE TABLE ' . $this->wrap($schema->getTableName()); $sql .= "(\n"; $sql .= $this->handleColumns($schema->getColumns()); $sql .= $this->handlePrimaryKey($schema); $sql .= $this->handleUniqueKeys($schema); $sql .= $this->handleForeignKeys($schema); $sql .= "\n)" . $this->handleEngine($schema); $commands = array(); $commands[] = array('sql' => $sql, 'params' => $this->getParams()); foreach ($this->handleIndexKeys($schema) as $index) { $commands[] = array('sql' => $index, 'params' => array()); } return $commands; }