laravel-oci8 icon indicating copy to clipboard operation
laravel-oci8 copied to clipboard

Why "max object name length is 30 chars"?

Open jsamaniegog opened this issue 3 years ago • 2 comments

Why does this method limit the name to 30 characters? I had to modify the value for the migrations to work because there was a conflict when matching the name of the table.

/**
     * Create an object name that limits to 30 chars.
     *
     * @param  string  $prefix
     * @param  string  $table
     * @param  string  $col
     * @param  string  $type
     * @return string
     */
    private function createObjectName($prefix, $table, $col, $type)
    {
        // max object name length is 30 chars
        return substr($prefix.$table.'_'.$col.'_'.$type, 0, 30);
    }
  • PHP Version: 8.0
  • Laravel Version: v8.83.2
  • Laravel-OCI8 Version: v8.6.2

Thank you.

jsamaniegog avatar Jun 14 '22 09:06 jsamaniegog

Per SO Post

In Oracle 12.2 and above the maximum object name length is 128 bytes. In Oracle 12.1 and below the maximum object name length is 30 bytes.

We are still using 10g on some projects so we are limited to 30. But I guess we can improve it now and make the length configurable. Accepting a PR if you can implement. Thanks!

yajra avatar Jun 15 '22 03:06 yajra

The real problem is that the length of $prefix + $table is 30. the solution could be to put $type as a prefix, regardless of making that length configurable.

What do you think about it?

jsamaniegog avatar Jun 15 '22 08:06 jsamaniegog

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar Oct 07 '22 03:10 github-actions[bot]

This issue was closed because it has been inactive for 7 days since being marked as stale.

github-actions[bot] avatar Oct 14 '22 04:10 github-actions[bot]