sgpatil / oriquent

Orientdb Eloquent driver for Laravel 5
MIT License
47 stars 15 forks source link

Can't refresh/reset/rollback migrations #5

Closed Dalamar closed 8 years ago

Dalamar commented 8 years ago

I get Nothing to rollback. after executing of php artisan orient:reset meanwhile the database remains untouched and all classes remains the same.

I get Nothing to rollback. after executing of php artisan orient:rollback meanwhile the database remains untouched and all classes remains the same.

I get Nothing to rollback. after executing of php artisan orient:refresh and exception

  [Sgpatil\Orientphp\Exception]
  Error: Unable to create Class

meanwhile the database remains untouched and all classes remains the same.

DJWassink commented 8 years ago

On a local test all these methods seem to result in the exception being thrown. (I did rename the batch from #6 to number, which did seem to fix the migration table.)

It also seems like the content of the request of the exception reveals a bit more about this issue. The error returned by Orient is "java.lang.IllegalArgumentException: Class '****' already exists" so it seems like a drop of a table is actually resulting in a create.

sgpatil commented 8 years ago

Hi @DJWassink , yes you are right. The drop method is always calling create class method

sgpatil commented 8 years ago

The problem has been solved. Try the updated code and inform

Dalamar commented 8 years ago

php artisan orient:rollback php artisan orient:reset

They both updates migrations table but they don't delete the schemas that were created during the migration being reseting/rolling back.

php artisan orient:refresh Retuns:

Rolled back: 2015_10_28_191606_create_countries_table
Nothing to rollback.
  [Sgpatil\Orientphp\Exception]
  Error: Unable to create Class

As the result, migration table is empty but all tables that were created during migrations remain in DB.

Dalamar commented 8 years ago

BTW which version of OrientDB do you guys use to test this driver?

sgpatil commented 8 years ago

I am using orientdb community 2.0 M1

sgpatil commented 8 years ago

Sorry @Dalamar , I just forgot to push changes of orientdb-php . Can you please recheck it using updated code once again.

Dalamar commented 8 years ago

Great! Thanks for quick resolving. Confirm. Now it works.

Dalamar commented 8 years ago

I use following versions for Mac OS X:

  1. OrientDB 2.1 Enterprise edition
  2. OrientDB 2.2 alpha (from download page)
  3. OrientDB 2.2 alpha nightly builds

OrientDB 2.2 alpha (from download page) works fine with column name 'batch' in migrations table. All other versions I use blaming on the 'batch' property and do not create migration records.

sgpatil commented 8 years ago

Closing the issue as it is fixed. Please let me know if you find any problem.