Mercurial > public > sg101
diff comments/migrations/0001_initial.py @ 1206:02181fa5ac9d modernize tip
Update to Django 1.9.
author | Brian Neal <bgneal@gmail.com> |
---|---|
date | Wed, 22 Jan 2025 17:58:16 -0600 |
parents | 5ba2508939f7 |
children |
line wrap: on
line diff
--- a/comments/migrations/0001_initial.py Sat Jan 04 21:34:31 2025 -0600 +++ b/comments/migrations/0001_initial.py Wed Jan 22 17:58:16 2025 -0600 @@ -24,8 +24,8 @@ ('ip_address', models.IPAddressField(verbose_name=b'IP Address')), ('is_public', models.BooleanField(default=True, help_text=b'Uncheck this field to make the comment invisible.')), ('is_removed', models.BooleanField(default=False, help_text=b'Check this field to replace the comment with a "This comment has been removed" message')), - ('content_type', models.ForeignKey(to='contenttypes.ContentType')), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ('content_type', models.ForeignKey(to='contenttypes.ContentType', on_delete=models.CASCADE)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, on_delete=models.CASCADE)), ], options={ 'ordering': ('creation_date',), @@ -36,8 +36,10 @@ fields=[ ('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)), ('flag_date', models.DateTimeField(auto_now_add=True)), - ('comment', models.ForeignKey(to='comments.Comment')), - ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL)), + ('comment', models.ForeignKey(to='comments.Comment', + on_delete=models.CASCADE)), + ('user', models.ForeignKey(to=settings.AUTH_USER_MODEL, + on_delete=models.CASCADE)), ], options={ 'ordering': ('flag_date',),