Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#22825 closed Cleanup/optimization (fixed)

DatabaseFeature supports_check_constraints and schema test_check_constraints

Reported by: Maximiliano Robaina Owned by: nobody
Component: Database layer (models, ORM) Version: 1.7-beta-2
Severity: Normal Keywords:
Cc: Andrew Godwin Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

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.

Change History (4)

comment:1 by Tim Graham, 10 years ago

Cc: Andrew Godwin added
Component: UncategorizedDatabase layer (models, ORM)
Type: UncategorizedCleanup/optimization

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

comment:2 by Andrew Godwin, 10 years ago

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.

comment:3 by Tim Graham, 10 years ago

Resolution: fixed
Status: newclosed

In 82c935d44cac6f041628fff4f32d1efdde96e720:

Renamed DatabaseFeature.supports_check_constraints to supports_column_check_

Thanks maxi for the suggestion.

comment:4 by Tim Graham, 10 years ago

In dc7d0f50e22bc52bc4656879452c482394347b75:

[1.7.x] Renamed DatabaseFeature.supports_check_constraints to supports_colum

Thanks maxi for the suggestion.

Backport of 82c935d44c from master

Note: See TracTickets for help on using tickets.
Back to Top