@@ -55,9 +55,9 @@ class Migration(migrations.Migration):
55
55
('topic_count' , models .IntegerField (default = 0 , verbose_name = 'Topic count' , blank = True )),
56
56
('hidden' , models .BooleanField (default = False , verbose_name = 'Hidden' )),
57
57
('headline' , models .TextField (null = True , verbose_name = 'Headline' , blank = True )),
58
- ('category' , models .ForeignKey (related_name = 'forums' , verbose_name = 'Category' , to = 'pybb.Category' )),
58
+ ('category' , models .ForeignKey (related_name = 'forums' , on_delete = models . CASCADE , verbose_name = 'Category' , to = 'pybb.Category' )),
59
59
('moderators' , models .ManyToManyField (to = settings .AUTH_USER_MODEL , verbose_name = 'Moderators' , blank = True )),
60
- ('parent' , models .ForeignKey (related_name = 'child_forums' , verbose_name = 'Parent forum' , blank = True , to = 'pybb.Forum' , null = True )),
60
+ ('parent' , models .ForeignKey (related_name = 'child_forums' , on_delete = models . CASCADE , verbose_name = 'Parent forum' , blank = True , to = 'pybb.Forum' , null = True )),
61
61
],
62
62
options = {
63
63
'ordering' : ['position' ],
@@ -71,8 +71,8 @@ class Migration(migrations.Migration):
71
71
fields = [
72
72
('id' , models .AutoField (verbose_name = 'ID' , serialize = False , auto_created = True , primary_key = True )),
73
73
('time_stamp' , models .DateTimeField (auto_now = True )),
74
- ('forum' , models .ForeignKey (blank = True , to = 'pybb.Forum' , null = True )),
75
- ('user' , models .ForeignKey (to = settings .AUTH_USER_MODEL )),
74
+ ('forum' , models .ForeignKey (blank = True , on_delete = models . CASCADE , to = 'pybb.Forum' , null = True )),
75
+ ('user' , models .ForeignKey (to = settings .AUTH_USER_MODEL , on_delete = models . CASCADE )),
76
76
],
77
77
options = {
78
78
'verbose_name' : 'Forum read tracker' ,
@@ -97,8 +97,8 @@ class Migration(migrations.Migration):
97
97
fields = [
98
98
('id' , models .AutoField (verbose_name = 'ID' , serialize = False , auto_created = True , primary_key = True )),
99
99
('timestamp' , models .DateTimeField (auto_now_add = True )),
100
- ('poll_answer' , models .ForeignKey (related_name = 'users' , verbose_name = 'Poll answer' , to = 'pybb.PollAnswer' )),
101
- ('user' , models .ForeignKey (related_name = 'poll_answers' , verbose_name = 'User' , to = settings .AUTH_USER_MODEL )),
100
+ ('poll_answer' , models .ForeignKey (related_name = 'users' , on_delete = models . CASCADE , verbose_name = 'Poll answer' , to = 'pybb.PollAnswer' )),
101
+ ('user' , models .ForeignKey (related_name = 'poll_answers' , on_delete = models . CASCADE , verbose_name = 'User' , to = settings .AUTH_USER_MODEL )),
102
102
],
103
103
options = {
104
104
'verbose_name' : 'Poll answer user' ,
@@ -137,7 +137,7 @@ class Migration(migrations.Migration):
137
137
('post_count' , models .IntegerField (default = 0 , verbose_name = 'Post count' , blank = True )),
138
138
('avatar' , get_image_field_class ()(upload_to = pybb .util .FilePathGenerator (to = b'pybb/avatar' ), null = True , verbose_name = 'Avatar' , blank = True )),
139
139
('autosubscribe' , models .BooleanField (default = True , help_text = 'Automatically subscribe to topics that you answer' , verbose_name = 'Automatically subscribe' )),
140
- ('user' , annoying .fields .AutoOneToOneField (related_name = 'pybb_profile' , verbose_name = 'User' , to = settings .AUTH_USER_MODEL )),
140
+ ('user' , annoying .fields .AutoOneToOneField (related_name = 'pybb_profile' , on_delete = models . CASCADE , verbose_name = 'User' , to = settings .AUTH_USER_MODEL )),
141
141
],
142
142
options = {
143
143
'verbose_name' : 'Profile' ,
@@ -159,7 +159,7 @@ class Migration(migrations.Migration):
159
159
('on_moderation' , models .BooleanField (default = False , verbose_name = 'On moderation' )),
160
160
('poll_type' , models .IntegerField (default = 0 , verbose_name = 'Poll type' , choices = [(0 , 'None' ), (1 , 'Single answer' ), (2 , 'Multiple answers' )])),
161
161
('poll_question' , models .TextField (null = True , verbose_name = 'Poll question' , blank = True )),
162
- ('forum' , models .ForeignKey (related_name = 'topics' , verbose_name = 'Forum' , to = 'pybb.Forum' )),
162
+ ('forum' , models .ForeignKey (related_name = 'topics' , on_delete = models . CASCADE , verbose_name = 'Forum' , to = 'pybb.Forum' )),
163
163
],
164
164
options = {
165
165
'ordering' : ['-created' ],
@@ -173,8 +173,8 @@ class Migration(migrations.Migration):
173
173
fields = [
174
174
('id' , models .AutoField (verbose_name = 'ID' , serialize = False , auto_created = True , primary_key = True )),
175
175
('time_stamp' , models .DateTimeField (auto_now = True )),
176
- ('topic' , models .ForeignKey (blank = True , to = 'pybb.Topic' , null = True )),
177
- ('user' , models .ForeignKey (to = settings .AUTH_USER_MODEL )),
176
+ ('topic' , models .ForeignKey (blank = True , on_delete = models . CASCADE , to = 'pybb.Topic' , null = True )),
177
+ ('user' , models .ForeignKey (to = settings .AUTH_USER_MODEL , on_delete = models . CASCADE )),
178
178
],
179
179
options = {
180
180
'verbose_name' : 'Topic read tracker' ,
@@ -201,19 +201,19 @@ class Migration(migrations.Migration):
201
201
migrations .AddField (
202
202
model_name = 'topic' ,
203
203
name = 'user' ,
204
- field = models .ForeignKey (verbose_name = 'User' , to = settings .AUTH_USER_MODEL ),
204
+ field = models .ForeignKey (verbose_name = 'User' , on_delete = models . CASCADE , to = settings .AUTH_USER_MODEL ),
205
205
preserve_default = True ,
206
206
),
207
207
migrations .AddField (
208
208
model_name = 'post' ,
209
209
name = 'topic' ,
210
- field = models .ForeignKey (related_name = 'posts' , verbose_name = 'Topic' , to = 'pybb.Topic' ),
210
+ field = models .ForeignKey (related_name = 'posts' , on_delete = models . CASCADE , verbose_name = 'Topic' , to = 'pybb.Topic' ),
211
211
preserve_default = True ,
212
212
),
213
213
migrations .AddField (
214
214
model_name = 'post' ,
215
215
name = 'user' ,
216
- field = models .ForeignKey (related_name = 'posts' , verbose_name = 'User' , to = settings .AUTH_USER_MODEL ),
216
+ field = models .ForeignKey (related_name = 'posts' , on_delete = models . CASCADE , verbose_name = 'User' , to = settings .AUTH_USER_MODEL ),
217
217
preserve_default = True ,
218
218
),
219
219
migrations .AlterUniqueTogether (
@@ -223,7 +223,7 @@ class Migration(migrations.Migration):
223
223
migrations .AddField (
224
224
model_name = 'pollanswer' ,
225
225
name = 'topic' ,
226
- field = models .ForeignKey (related_name = 'poll_answers' , verbose_name = 'Topic' , to = 'pybb.Topic' ),
226
+ field = models .ForeignKey (related_name = 'poll_answers' , on_delete = models . CASCADE , verbose_name = 'Topic' , to = 'pybb.Topic' ),
227
227
preserve_default = True ,
228
228
),
229
229
migrations .AlterUniqueTogether (
@@ -239,7 +239,7 @@ class Migration(migrations.Migration):
239
239
migrations .AddField (
240
240
model_name = 'attachment' ,
241
241
name = 'post' ,
242
- field = models .ForeignKey (related_name = 'attachments' , verbose_name = 'Post' , to = 'pybb.Post' ),
242
+ field = models .ForeignKey (related_name = 'attachments' , on_delete = models . CASCADE , verbose_name = 'Post' , to = 'pybb.Post' ),
243
243
preserve_default = True ,
244
244
),
245
245
]
0 commit comments