[Django] #22825: DatabaseFeature supports_check_constraints and schema test_check_constraints

11 views
Skip to first unread message

Django

unread,
Jun 12, 2014, 5:05:30 PM6/12/14
to django-...@googlegroups.com
#22825: DatabaseFeature supports_check_constraints and schema
test_check_constraints
-------------------------------+------------------------
Reporter: maxi | Owner: nobody
Type: Uncategorized | Status: new
Component: Uncategorized | Version: 1.7-beta-2
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------
DB Backends can define a database feature called
supports_check_constraints, but what does it mean?

Running the schema tests, test_check_constraints skips it if the backend
doesn't supports check constraints, but it seem like is trying to test
column based check constraints. In my case Firebird just support table
based check constraints, so the test_check_constraints fails.

My proposal is to change the supports_check_constraints name to something
more explicit like supports_column_based_check_constraints.

--
Ticket URL: <https://code.djangoproject.com/ticket/22825>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jun 16, 2014, 8:59:40 AM6/16/14
to django-...@googlegroups.com
#22825: DatabaseFeature supports_check_constraints and schema
test_check_constraints
-------------------------------------+-------------------------------------
Reporter: maxi | Owner: nobody
Type: | Status: new
Cleanup/optimization | Version:
Component: Database layer | 1.7-beta-2
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* cc: andrewgodwin (added)
* needs_better_patch: => 0
* component: Uncategorized => Database layer (models, ORM)
* needs_tests: => 0
* needs_docs: => 0
* type: Uncategorized => Cleanup/optimization


Comment:

It was added in [ca9c3cd3] by Andrew. CCing him for his thoughts.

--
Ticket URL: <https://code.djangoproject.com/ticket/22825#comment:1>

Django

unread,
Jun 16, 2014, 1:57:06 PM6/16/14
to django-...@googlegroups.com
#22825: DatabaseFeature supports_check_constraints and schema
test_check_constraints
-------------------------------------+-------------------------------------
Reporter: maxi | Owner: nobody

Type: | Status: new
Cleanup/optimization | Version:
Component: Database layer | 1.7-beta-2
(models, ORM) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by andrewgodwin):

Yes, it is only for column-based check constraints (the only type Django
uses) - it's for things like PositiveIntegerField's check that `>= 0` and
stuff like that.

I'm fine with renaming it.

--
Ticket URL: <https://code.djangoproject.com/ticket/22825#comment:2>

Django

unread,
Jun 16, 2014, 7:26:35 PM6/16/14
to django-...@googlegroups.com
#22825: DatabaseFeature supports_check_constraints and schema
test_check_constraints
-------------------------------------+-------------------------------------
Reporter: maxi | Owner: nobody
Type: | Status: closed

Cleanup/optimization | Version:
Component: Database layer | 1.7-beta-2
(models, ORM) | Resolution: fixed

Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => fixed


Comment:

In 82c935d44cac6f041628fff4f32d1efdde96e720:

Renamed DatabaseFeature.supports_check_constraints to
supports_column_check_

Thanks maxi for the suggestion.

--
Ticket URL: <https://code.djangoproject.com/ticket/22825#comment:3>

Django

unread,
Jun 16, 2014, 7:27:14 PM6/16/14
to django-...@googlegroups.com
#22825: DatabaseFeature supports_check_constraints and schema
test_check_constraints
-------------------------------------+-------------------------------------
Reporter: maxi | Owner: nobody

Type: | Status: closed
Cleanup/optimization | Version:
Component: Database layer | 1.7-beta-2
(models, ORM) | Resolution: fixed
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by timo):

In dc7d0f50e22bc52bc4656879452c482394347b75:

[1.7.x] Renamed DatabaseFeature.supports_check_constraints to
supports_colum

Thanks maxi for the suggestion.

Backport of 82c935d44c from master

--
Ticket URL: <https://code.djangoproject.com/ticket/22825#comment:4>

Reply all
Reply to author
Forward
0 new messages