SectorLabs / django-postgres-extra

Bringing all of PostgreSQL's awesomeness to Django.
MIT License
699 stars 96 forks source link

Trying to roll back to old engine. #204

Closed Wadhah-Sky closed 1 year ago

Wadhah-Sky commented 1 year ago

I faced three major problems with this package:

1- trying to roll back to old engine django.db.backends.postgresql impossible unless you delete the entire database. 2- if you by mistake add unique=True to field that doesn't support it, will be nightmare to delete the field and the constraint. 3- the engine "ENGINE": "psqlextra.backend" will not works fine if you delete the migrations files and re-run the migration process.

Thanx.

Photonios commented 1 year ago

Switching database back-ends halfway through a project is usually impossible. It is not an issue specific to this project. All your migrations are expected to break if you switch engines as the current engine is not specified in the migration.

The only way to do it is to delete all migrations you created up until now, switch the engine and re-create the initial migration. You cannot not continue to use features from django-postgres-extra if you do this.