Skip to content

Deprecate a whole model? #31

@soerface

Description

@soerface

Do you have any experience deprecating a whole model, not just a field? What I tried is to deprecate and then remove every field, so now I'm left with:

class MyModel(models.Model):
    pass

Still, this for some reason makes the Django ORM still issue queries in the form of SELECT "my_model"."id" FROM "my_model" ORDER BY "my_model"."id" ASC, seemingly for every test that is marked with the @pytest.mark.django_db decorator.

(Background: The CI pipeline is making a migration to the latest DB version, i.e. a revision where I dropped MyModel, and then executing the test suite of the previous software version, i.e. with the model still in place, to make sure that the previous version can run on the latest schema. This enforces us to always use deprecate_field(...) before dropping a column, but now I'm left without a clue how to apply this on a model level)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions