Skip to content

Custom indexes has no strings, php detects constant. #402

@mikevandiepen

Description

@mikevandiepen
  • Laravel Version: 8.x (latest)
  • PHP Version: 7.4.13
  • Blueprint Version: 1.19
  • Platform: Mac | Windows | Linux

Issue:

When generating custom indexes the index will be printed without '' which causes it to fail on the migrations.

Schema::disableForeignKeyConstraints();
     17▕
     18▕         Schema::create('cooltable', function (Blueprint $table) {
     19▕             $table->id();
  ➜  20▕             $table->foreignId('coolcool')->constrained()->cascadeOnDelete()->index(custom_index_coolcool);
     21▕             $table->foreignId('foobar')->constrained()->cascadeOnDelete()->index(custom_index_foobar);
     22▕         });

draft.yaml:

# PLEASE PASTE THE DRAFT FILE WHICH REPRODUCES THE ISSUE HERE...

Draft is not required, a custom index will fail because it misses strings, therefore php detects is as a constant which is not defined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingpendingThis issue is pending review

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions