laravel-oci8
laravel-oci8 copied to clipboard
Can't Rollback. Throws an error while deleting sequences
Summary of problem or feature request
I'm not able to run php artisan migrate:rollback or php artisan migrate:fresh cause it tries to drop sequences generated by the system.
If I manually delete sequences generated by Laravel, php artisan migrate works just fine.
System details
- Operating System : W10
- PHP Version : 7.3.8
- Laravel Version : 7.16.1
- Laravel-OCI8 Version : 7.0.1
Yajra\Pdo\Oci8\Exceptions\Oci8Exception::("Error Code : 32794 Error Message : ORA-32794: no se puede borrar una secuencia generada por el sistema ORA-06512: en línea 7 ORA-06512: en línea 7 Position : 0 Statement : BEGIN FOR c IN (SELECT table_name FROM user_tables) LOOP EXECUTE IMMEDIATE ('DROP TABLE "' || c.table_name || '" CASCADE CONSTRAINTS'); END LOOP;
FOR s IN (SELECT sequence_name FROM user_sequences) LOOP
EXECUTE IMMEDIATE ('DROP SEQUENCE ' || s.sequence_name);
END LOOP;
END;
Bindings : [] ")
The last sequences are generated by a previous php artisan migrate successful execution

I have the exact same issue and even DROP ANY SEQUENCE permissions didn't help.
Might be a grant privilege issue? Is the schema you are using allowed to drop objects?
Yes, I do not suggest using php artisan migrate:fresh when working with existing database cause it will drop all the DB objects.
Lastly, we do php artisan migrate:refresh most of the time on our projects and seems to work fine. When it fails, you would need to manually drop the objects as needed based on the error returned.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 7 days since being marked as stale.