5 | | 1. Create a model `SubModel`, it must derive from `models.Model`. |
6 | | 2. Create a new base class, `BaseModel`, it must derive from `models.Model` |
7 | | 3. Add: `basemodel_ptr = OneToOneField(BaseModel, null=True)` on `SubModel`. The field *must* be named like the class name of the new base class. |
8 | | 4. Automatically create a migration |
9 | | 5. Create a data migration that creates a new `BaseModel(id=submodel.id)` for each `SubModel` instance. This step is only necessary if you have created `SubModel` objects. Otherwise, just use an automatic default. |
10 | | 6. Set the base model of `SubModel` to `BaseModel` |
11 | | 7. Automatically create a migration |
12 | | 8. Rename `BaseModel` to `RenamedBaseModel` |
13 | | 9. Automatically create a migration, accepting the two automatic suggestions |
14 | | 10. Migrate! |
15 | | |
16 | | At this point, you can see that `RenamedBaseModel` works as expected. It appears as though everything here works, as long as you aren't tracking the base class when migrations first creates the model. |
| 5 | You can see that `RenamedBaseModel` works as expected. It appears as though everything here works, as long as you aren't tracking the base class when migrations first creates the model. |