django / django/new-features

A way to deprecate ORM expressions

Open
#101 3 comments 6 reactions 0 assignees View on GitHub
Checks Django Core Models/ORM
Dominant language
No language data
Stars
188
Forks
7
PR merge metrics
No merged PRs in 30d

Description

### Code of Conduct

- [x] I agree to follow Django's Code of Conduct

### Feature Description

As a third-party app author or core Django contributor, I would like to have a way to deprecate an ORM expression without emitting hundreds of warnings over uses in historical migrations.

### Problem

Django's getting ready to move on from the `RandomUUID` expression in favor of `UUID4` in django/django#20101.

Since the advent of `db_default`, expressions might exist in historical migrations. It would be noisy to emit deprecation warnings all over those. We might also decide to warn users about the upgrade possibility but leave a husk forever, like we did with `NullBooleanField`.

@LilyFirefly pointed out we have a whole [documented apparatus for deprecating a field](https://docs.djangoproject.com/en/6.0/topics/migrations/#considerations-when-removing-model-fields) but lack anything for expressions referenced by fields.

This led to the choice in django/django#20101 to just not warn/deprecate anywhere, knowing we could always do it later.

### Request or proposal

request

### Additional Details

_No response_

### Implementation Suggestions

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.