Skip to content

Modifying on_delete from default CASCADE to SET_NULL and running aerich migrate does not generate migration file #2014

@dlee1579

Description

@dlee1579

Describe the bug
I am attempting to change a foreign key on my data model to explicity set on_delete behavior to SET_NULL. Since default on_delete behavior is CASCADE, after running aerich migrate I wouild expect a new migration file to have been generated. Instead, no changes are recognized.

To Reproduce
change

example_fk_field = fields.ForeignKeyField("models.OtherModel")

to

example_fk_field = fields.ForeignKeyField("models.OtherModel", on_delete=fields.SET_NULL)

Expected behavior
Database migration file should be generated upon running aerich migrate.

Additional context
None

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