delighted.rock
delighted.rock

Reputation: 83

Naming convention for Django migrations

Is there a best practice naming convention for Django migrations?

If it's a small migration the names are pretty obvious, but things get harry when multiple fields are being changed. Just wondering if anyone has a standard they like to use.

Upvotes: 1

Views: 2933

Answers (1)

Michał Darowny
Michał Darowny

Reputation: 414

When you want to add some meaningful name instead of auto generated one docs specify you should do:

python manage.py makemigrations --name changed_my_model your_app_label

so I think you should give some short info and app label.

when you are writing your own migrations and changing a lot of fields maybe separating them can be good idea to keep names short.

But personally I don't see the point to change generated names.

Upvotes: 6

Related Questions