Skip to content

[Bug] Wrong Index generation #37

@YannPl

Description

@YannPl

It seems that the indexes generation is kinda bugged in some cases.

I have a special use case: I have a database that is half
manually generated and half with migrations.

When you create indexes (On a single field) manually in phpMyAdmin, they are named after the field.
Ex: field parent_id will generate the index parent_id

When you create indexes via migrations in laravel, they are named following a naming convention.
Ex: the migration line $table->index('parent_id'); on a table named module_module will generate the index name ''module_module_parent_id_index".

Your package seems to use the index name as the field on which to execute the index command.
So I have lines like that in my generated migration:
$table->index('module_module_parent_id_index');

And obviously that line fails because there is no field named module_module_parent_id_index.

it would be super cool if it could generate the proper index instructions ! =)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions