Skip to content

UUID column generates a reference when use_constraints config option is enabled #417

@tanthammar

Description

@tanthammar
  • Laravel Version: 8.22.1
  • PHP Version: 8.0
  • Blueprint Version: 1.20.2
  • Platform: Mac

Issue:

If I name a UUID column to 'uuid' Blueprint generates a foreign key to a table that doesn't exist.

draft.yaml:

models:
  Vat:
    uuid: uuid

Expected outcome

        Schema::create('vats', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid');
            $table->timestamps();
        });

Blueprint generates a foreign key to a table that doesn't exist:

        Schema::create('vats', function (Blueprint $table) {
            $table->id();
            $table->uuid('uuid');
            $table->foreign('uuid')->references('uuid')->on('uuids')->onDelete('cascade');
            $table->timestamps();
        });

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions