Opened 4 years ago
Closed 4 years ago
#33652 closed New feature (wontfix)
Skip ExclusionConstraint on non-PostgreSQL databases.
| Reported by: | hottwaj | Owned by: | nobody |
|---|---|---|---|
| Component: | Migrations | Version: | dev |
| Severity: | Normal | Keywords: | postgres exclusion constraint |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
Exclusion constraints are only supported by postgres, and using them with e.g. a sqlite backend causes an exception during migrations when django attempts to insert them into the DB.
Could exclusion constraints be skipped when migrations are run for non-postgres backends instead? Perhaps with a warning that they are being skipped?
This would help in situations where multiple backends are used for testing/prototyping purposes
Change History (1)
comment:1 by , 4 years ago
| Component: | Database layer (models, ORM) → Migrations |
|---|---|
| Resolution: | → wontfix |
| Status: | new → closed |
| Summary: | migrations: skip insertion of exclusion constraints when not using postgres → Skip ExclusionConstraint on non-PostgreSQL databases. |
Note:
See TracTickets
for help on using tickets.
Thanks for this report. We strongly recommend that you use the same database for testing and a real-life apps. There are many differences and you may encounter unexpected issues by using a different backend for testing. Therefore, we don't want to encourage users to do this by automatically skipping PostgreSQL-specific features. If you really have to do this you can skip PostgreSQL constraints/indexes in migration files, e.g.