You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
now i want to delete poly base model and transfer records from base model to teachers table.
i cant create new class like NewTeacher because i used many times teacher model in project. any documentation to do this ?
The text was updated successfully, but these errors were encountered:
Add the fields review_average_temp, tags_temp, and sort_temp to Teacher as nullable fields and makemigrations. Make a data migration that copies all data from BaseModel to the temporary rows in Teacher. Remove the base model from Teacher instead inheriting from models.Model and makemigrations. Rename the fields you added to remove temp and makemigrations.
Make sure you check the generated migrations each time to see that it's picking up the right renames and not creating blank new stuff and deleting the old stuff.
This is a Django thing, rather than a polymorphic thing, which is why you may be having difficulty finding documentation. The search term that will help you find more help is "django data migrations".
hey all wish have a good day. i have some models like this:
now i want to delete poly base model and transfer records from base model to teachers table.
i cant create new class like NewTeacher because i used many times teacher model in project. any documentation to do this ?
The text was updated successfully, but these errors were encountered: