Skip to content

Commit

Permalink
fix(models): make icao code of the aerodrome unique
Browse files Browse the repository at this point in the history
  • Loading branch information
zyv committed Nov 4, 2023
1 parent deb847b commit 5322ded
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions logbook/migrations/0026_alter_aerodrome_icao_code.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 4.2.7 on 2023-11-04 16:30

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("logbook", "0025_pilot_only_one_me"),
]

operations = [
migrations.AlterField(
model_name="aerodrome",
name="icao_code",
field=models.CharField(max_length=4, unique=True),
),
]
2 changes: 1 addition & 1 deletion logbook/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Aerodrome(models.Model):
name = models.CharField(max_length=75)
city = models.CharField(max_length=75)
country = CountryField()
icao_code = models.CharField(max_length=4)
icao_code = models.CharField(max_length=4, unique=True)
latitude = models.DecimalField(max_digits=9, decimal_places=6)
longitude = models.DecimalField(max_digits=9, decimal_places=6)
elevation = models.IntegerField()
Expand Down

0 comments on commit 5322ded

Please sign in to comment.