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

Limit chars in dropConstraint

ramonribeiro96 opened this issue · comments

Summary of problem or feature request

I've created FK

$table->foreign('tag_id', 'FK_STUDY_HAS_PHYSICIAN_HAS_TAGS_TAG_ID')
->references('id')->on('tags')
->onDelete('cascade')
->onUpdate('cascade');

with length chars more 30 'FK_STUDY_HAS_PHYSICIAN_HAS_TAGS_TAG_ID' and dropConstraint method is limited in 30.

    private function dropConstraint(Blueprint $blueprint, Fluent $command, $type)
    {
        $table = $this->wrapTable($blueprint);
        $index = substr($command->index, 0, 30);

        if ($type === 'index') {
            return "drop index {$index}";
        }

        return "alter table {$table} drop constraint {$index}";
    }

Causing:

Error Message : ORA-02443: Cannot drop constraint - nonexistent constraint
Position : 57
Statement : alter table study_has_physician_has_tags drop constraint FK_STUDY_HAS_PHYSICIAN_HAS_TAG

Could you make this configurable?

  • Linux subsystem (WSL2)
  • PHP 7.4
  • Laravel 7
  • Laravel-OCI8 ^7

FK_STUDY_HAS_PHYSICIAN_HAS_TAGS_TAG_ID will be shortened behind the scene. Please use exactly 30 chars as this is an Oracle DB limitation. Future releases will have a 128 longer char.

Related PR:

#768
#767
#762