yajra / laravel-oci8

Oracle DB driver for Laravel via OCI8

Home Page:https://yajrabox.com/docs/laravel-oci8

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inite loop on OracleBlueprint createIndexName

edcaron opened this issue · comments

Summary of problem or feature request

Using the migrations from laravel, When creating an index on a table with lots of underscore character and big length, the execution gets stuck.
Debugged the code and found out that the function createIndexName on the class OracleBlueprint tries to reduce the string to 30 chars, but respecting the rule of at least 2 chars after the underscore character but then when there are lots of underscores, summing up all the splits it it passes 30 chars, an then there is the inifite loop.

Code snippet of problem

Schema::create(
            'servidor_lotacao_distr_ch', function (Blueprint $table) {
                $table->id();
                $table->unsignedBigInteger('categoria_ser_lot_distr_ch_id')->index();
            }
        );

System details

  • Operating System: Ubuntu 22
  • PHP Version: 8.1
  • Laravel Version: v9.43
  • Laravel-OCI8 Version: v9.1.0

Depending on your Oracle version, you can use a more prominent index/object name. See PR #777

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.