python - OperationalError: no such table on some ManyToManyFields only -


i creating website product , user models, , wanted create multiple manytomany fields user model (products purchased, sold, etc). when added first cart manytomanyfield on user model , tried in shell:

user.objects.get(username="root").cart.all() 

it worked fine , outputted query set of objects of user's cart.

but added other 3 manytomanyfields user model:

items_purchased = models.manytomanyfield("product", related_name="items_purchased") items_sold = models.manytomanyfield("product", related_name="items_sold") items_listed = models.manytomanyfield("product", related_name="items_listed") 

however, once checked latest fields:

user.objects.get(username="root").items_purchased.all() 

i got error:

operationalerror: no such table: home_user_items_purchased 

what tried:

  • i made migrations , have synced them database.
  • i deleted every migration files except init , 0001.
  • i tried migrate migration files seperately in application.

is there way can fix problem without clearing out whole database? django's problem or have done wrong? thanks!


Comments

Popular posts from this blog

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

android - ConstraintLayout: Realign baseline constraint in case if dependent view visibility was set to GONE -

c# - Populating Gridview inside Listview ItemTemplate On Web User Control from Code Behind -