method createIndex documentation in bbn\Db\Languages\Mysql

Creates an index

function(string $table, $column, bool $unique = false, $length = NULL) { $column = (array)$column; if ($length) { $length = (array)$length; } $name = Str::encodeFilename($table); if ($table = $this->tableFullName($table, true)) { foreach ($column as $i => $c) { if (!Str::checkName($c)) { $this->error("Illegal column $c"); } $name .= '_' . $c; $column[$i] = $this->escape($column[$i]); if (isset($length[$i]) && \is_int($length[$i]) && $length[$i] > 0) { $column[$i] .= '(' . $length[$i] . ')'; } } $name = Str::cut($name, 50); return (bool)$this->rawQuery( 'CREATE ' . ($unique ? 'UNIQUE ' : '') . "INDEX `$name` ON $table ( " . implode(', ', $column) . ' )' ); } return false; }

Creates an index BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.