Opened 5 years ago

Closed 5 years ago

Last modified 5 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


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 Changed 5 years ago by Tim Graham

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 Changed 5 years ago by Andrew Godwin

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 Changed 5 years ago by Tim Graham

Resolution: fixed
Status: newclosed

In 82c935d44cac6f041628fff4f32d1efdde96e720:

Renamed DatabaseFeature.supports_check_constraints to supports_column_check_

Thanks maxi for the suggestion.

comment:4 Changed 5 years ago by Tim Graham

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