db.migrations.operations.RenameModel

class RenameModel(old_name, new_name) [source]

Renames the model from an old name to a new one.

You may have to manually add this if you change the model’s name and quite a few of its fields at once; to the autodetector, this will look like you deleted a model with the old name and added a new one with a different name, and the migration it creates will lose any data in the old table.

doc_Django
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.