Yajra\Oci8\Schema\OracleBlueprint::createIndexName PHP Method

createIndexName() protected method

Create a default index name for the table.
protected createIndexName ( string $type, array $columns ) : string
$type string
$columns array
return string
    protected function createIndexName($type, array $columns)
    {
        $short_type = ['primary' => 'pk', 'foreign' => 'fk', 'unique' => 'uk'];
        $type = isset($short_type[$type]) ? $short_type[$type] : $type;
        $index = strtolower($this->prefix . $this->table . '_' . implode('_', $columns) . '_' . $type);
        // max index name length is 30 chars
        return substr(str_replace(['-', '.'], '_', $index), 0, 30);
    }