laravel-oci8
laravel-oci8 copied to clipboard
Why "max object name length is 30 chars"?
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.
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!
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?
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.