django/django — pull request #3161 by mjtamlyn (2014-09-04 15:37:09+00:00)
Title: Fixed #23416 -- Make sure DatabaseCreation respects checks.

Migrations respected Field.db_parameters()['check'], but DatabaseCreation was still using just Field.db_type().

[Ticket](https://code.djangoproject.com/ticket/23416)

@bmispelon @andrewgodwin

I believe this fixes the problem. The alternative is to attempt to rework the changes made in d22b291890c1736a40c0ad97448c7318df2eebb2 so as to maintain backwards compatibility that `db_type()` returns the check constraint, but it comes separately from `db_parameters()`. Given `db_type()` is public API I don't see a way to fix this.

This should be backported to 1.7.X and included in a 1.7.1 release, probably quite soon as it influences `CREATE TABLE` statements for any field using `CHECK` if not using migrations.