Remove foreign key dependency range <-> rangeonlineinfo
This commit is contained in:
parent
1960abdbcb
commit
8020fa955e
4 changed files with 42 additions and 8 deletions
19
app/migrations/0048_alter_rangeonlineinfo_range_name.py
Normal file
19
app/migrations/0048_alter_rangeonlineinfo_range_name.py
Normal file
|
@ -0,0 +1,19 @@
|
|||
# Generated by Django 3.2.5 on 2021-11-30 08:08
|
||||
|
||||
from django.db import migrations, models
|
||||
import django.db.models.deletion
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0047_alter_mountainrange_area'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='rangeonlineinfo',
|
||||
name='range_name',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='app.mountainrange', to_field='range_name_map'),
|
||||
),
|
||||
]
|
18
app/migrations/0049_alter_rangeonlineinfo_range_name.py
Normal file
18
app/migrations/0049_alter_rangeonlineinfo_range_name.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Generated by Django 3.2.5 on 2021-11-30 08:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0048_alter_rangeonlineinfo_range_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterField(
|
||||
model_name='rangeonlineinfo',
|
||||
name='range_name',
|
||||
field=models.TextField(blank=True, null=True),
|
||||
),
|
||||
]
|
|
@ -1,4 +1,4 @@
|
|||
# Generated by Django 3.2.5 on 2021-11-29 04:12
|
||||
# Generated by Django 3.2.5 on 2021-11-30 08:09
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
@ -6,7 +6,7 @@ from django.db import migrations, models
|
|||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('app', '0047_alter_mountainrange_area'),
|
||||
('app', '0049_alter_rangeonlineinfo_range_name'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
|
@ -15,9 +15,4 @@ class Migration(migrations.Migration):
|
|||
name='range_name_map',
|
||||
field=models.CharField(blank=True, max_length=128, null=True),
|
||||
),
|
||||
migrations.AlterField(
|
||||
model_name='rangeonlineinfo',
|
||||
name='range_name',
|
||||
field=models.TextField(blank=True, null=True),
|
||||
),
|
||||
]
|
|
@ -89,6 +89,7 @@ class MountainRange(models.Model):
|
|||
countries = models.TextField(blank=True, null=True)
|
||||
|
||||
range_name_map = models.CharField(blank=True, null=True, max_length=128)
|
||||
#range_name_map = models.CharField(blank=True, null=True, unique=True, max_length=128)
|
||||
range_name = models.CharField(blank=True, null=True, max_length=128)
|
||||
range_name_ascii = models.CharField(blank=True, null=True, max_length=128)
|
||||
range_name_language = models.ForeignKey(Language, models.DO_NOTHING, blank=True, null=True, to_field='id')
|
||||
|
@ -428,7 +429,8 @@ class RangeOnlineInfo(models.Model):
|
|||
id = models.AutoField(primary_key=True)
|
||||
# This is supposed to be linked to MountainRange via range_name_map, but the range_name_map
|
||||
# is not itself unique. Are we missing something? TODO: Investigate
|
||||
# range_name = models.ForeignKey(MountainRange, models.DO_NOTHING, blank=True, null=True, to_field='range_name_map')
|
||||
#range_name = models.ForeignKey(MountainRange, models.DO_NOTHING, blank=True, null=True, to_field='range_name_map')
|
||||
#range_name = models.ForeignKey(MountainRange, blank=True, null=True, to_field='range_name_map', on_delete=models.CASCADE)
|
||||
range_name = models.TextField(blank=True, null=True)
|
||||
info_source = models.TextField(blank=True, null=True)
|
||||
url = models.TextField(blank=True, null=True)
|
||||
|
|
Loading…
Reference in a new issue