* status: new => closed
* resolution: => wontfix
* component: Database layer (models, ORM) => Migrations
Comment:
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.
{{{#!python
class Migration(migrations.Migration):
dependencies = [
('test_33652', '0001_initial'),
]
if connection.vendor == 'postgresql':
operations = [
migrations.AddConstraint(
model_name='hotelreservation',
constraint=django.contrib.postgres.constraints.ExclusionConstraint(condition=models.Q(('cancelled',
False)), expressions=[('room', '=')],
name='exclude_overlapping_reservations'),
),
]
else:
operations = []
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/33652#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.