Setting Django 'unique' model field parameter after creation of model objects with non-unique values for that field?
问题 I have a 'project' Model and I've created 4 of them with the names 'Alan Parson's', 'Gutenberg', 'Gutenberg' and 'X.' I just realized, I want the names to be unique, so I set unique = True on the project.name field Now, I can't create another 'Gutenberg' or 'X' or whatever, but django has no issue with the fact that previous models have non-unique names. How is django ensuring uniqueness of the new fields? Why doesn't it matter that old ones are non-unique, and -in general- is there anyway to