Xethron / migrations-generator

Laravel Migrations Generator: Automatically generate your migrations from an existing database schema.
MIT License
3.33k stars 586 forks source link

Migrations attempt to create indices twice. #19

Closed joboscribe closed 10 years ago

joboscribe commented 10 years ago

I have the following line in a generated migration:

$table->float('more_than', 10, 0)->default(25)->index('`more_than`');

Which is in turn generating the following error:

[Illuminate\Database\QueryException]
SQLSTATE[HY000]: General error: 1 index more_than already exists (SQL: create index `more_than` on "discounts" ("more_than"))

Moving the index step to its own line (and removing the backticks, ha ha) works fine:

$table->index('more_than');

But the following line works just fine (backticks and all):

$table->enum('shipmethod', array('1', '2', '3', '4', '5', '6', '7'))->default('1')->index('`shipmethod`');
Xethron commented 10 years ago

Could you test and check if this still happens?

joboscribe commented 10 years ago

Generated the same migration just now and it worked brilliantly.

Thank you.

Xethron commented 10 years ago

Great, thanks!