Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4c20f98

Browse files
🔨 fix model.CASCADE to model.DO_NOTHING
1 parent e3cd938 commit 4c20f98

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Generated by Django 3.0.6 on 2020年09月12日 16:55
2+
3+
from django.db import migrations, models
4+
import django.db.models.deletion
5+
6+
7+
class Migration(migrations.Migration):
8+
9+
dependencies = [
10+
('api', '0001_initial'),
11+
]
12+
13+
operations = [
14+
migrations.AlterField(
15+
model_name='student',
16+
name='student_school_name',
17+
field=models.ForeignKey(default='', on_delete=django.db.models.deletion.DO_NOTHING, to='api.School'),
18+
),
19+
]

‎api/models.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Student(models.Model):
1313
Student_roll_no = models.IntegerField()
1414
student_registration_no = models.IntegerField(default=0)
1515
student_subject = models.TextField()
16-
student_school_name = models.ForeignKey(School, on_delete=models.CASCADE, default="")
16+
student_school_name = models.ForeignKey(School, on_delete=models.DO_NOTHING, default="")
1717

1818

1919
def __str__(self):

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /