public function createTable($name) { try { $table = new Table($name, [new Column(DatabaseTable::COLUMN_ID, Type::getType(Type::INTEGER), ['primary' => true, 'autoincrement' => true, 'notnull' => true])]); $this->getSchema()->createTable($table); } catch (DBALException $e) { throw DatabaseException::fromDBALException($e); } }
public static function createTable(Connection $connection, $tableName) { $table = new Table($tableName, [new Column(DatabaseTable::COLUMN_ID, Type::getType(Type::INTEGER), ['primary' => true, 'autoincrement' => true, 'notnull' => true])]); try { $connection->getSchemaManager()->createTable($table); } catch (DBALException $e) { throw DatabaseException::fromDBALException($e); } }