private static function generateGeneral(Template $template, Table $table) { $template->set('tableName', $table->getName()); $template->set('engine', $table->getEngine()); $template->set('collate', $table->getCollate()); // if ($table->getAutoIncrement() !== null) { // $template->set('autoIncrement', $table->getAutoIncrement()); // } }
public final function dropReferences() { $current = Connection::getTableReferences($this->table->getName()); $new = $this->table->getReferences(); $this->drop($current, $new, $this->table->getName(), 'FOREIGN KEY'); }
public static function fillTableColumns(Table $table) { $res = self::query("SHOW FULL COLUMNS FROM `" . $table->getName() . "`"); if ($res) { $previous = false; while ($c = $res->fetch_array()) { if (!$previous) { $c['first'] = true; } else { $c['after'] = $previous; } $table->addColumn(new Column($c['Field'], $c)); $previous = $c['Field']; } } }