Not be able to delete child tables in SQLAlchemy using in Fast api

Below i have three tables which have many to many relationship between them, the problem is i am not be able to delete user table the database say: “constraint imagesmetadata_user_id_fkey on table imagesmetadata depends on table users constraint tokens_user_id_fkey on table tokens depends on table userscannot drop table users because other objects depend on it”

The only way i can delete user table after deleting token and images meta data table

Although i already have put this cascade="all, delete-orphan" in my code but still it doesn’t work can some body please help ??

here is my model code:

User file:
[postgresql]

Hm, not sure how this is related to webMethods. Can you elaborate?

1 Like