On zaterdag 23 juni 2018 14:40:30 CEST Jason wrote: > Not quite. If you run python manage.py sqlmigrate <appname> > <migration_name>, you can see the SQL generated for that migration. > > https://docs.djangoproject.com/en/2.0/ref/django-admin/#django-admin-sqlmigr > ate > > Because Django emulates Cascade, its done outside of the db, and therefore > shouldn't be a db-level constraint.
The case for and against can be made pretty much with the same argument: - for: if a row is deleted outside of Django, so by direct database manipulation, then the relations become inconsistent, so having database reflect models prevents this. - against: if a row is deleted outside of Django, so by direct database manipulation, then signals are not processed and objects are deleted regardless. The consequences of this are unpredictable and application specific. Django chose to not align model relations with database representation. Knowing this means you have to handle things through Django exclusively where it matters. -- Melvyn Sopacua -- You received this message because you are subscribed to the Google Groups "Django users" group. To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscr...@googlegroups.com. To post to this group, send email to django-users@googlegroups.com. Visit this group at https://groups.google.com/group/django-users. To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2141218.LMxEerG5hG%40fritzbook. For more options, visit https://groups.google.com/d/optout.