sbarre / eloquent-versioned

Add transparent versioning to Laravel 5's Eloquent ORM
MIT License
30 stars 11 forks source link

Readme for dropping columns/indexes #13

Open EspadaV8 opened 9 years ago

EspadaV8 commented 9 years ago

Rather than create a PR for this I just wanted to check to see if the dropColumn/dropIndex down migrations work for anyone else. For me it tried to concatenate the index names together to give something like users_model_id_version_is_current_version_index. Dropping the columns before the indexes also gives an error about it not existing. I think it needs to be changed to something like

$table->dropIndex($table->getTable() . 'model_id_index');
$table->dropIndex($table->getTable() . '_version_index');
$table->dropIndex($table->getTable() . '_is_current_version_index');
$table->dropColumn('model_id');
$table->dropColumn('version');
$table->dropColumn('is_current_version');
sbarre commented 9 years ago

I'll write a proper test for this on Thursday, I kind of did that part of the README from memory and the docs. I may have it wrong.