Files
VacatureRadar/apps/jobs/migrations/0002_geocode_location_lookup.py
T
Jens b8091e59bd
deploy / deploy (push) Canceled after 0s
Initial deploy setup
2026-07-21 14:00:00 +02:00

68 lines
2.8 KiB
Python

# Generated by Django 5.2.16 on 2026-07-21 for VR-104
import django.db.models.deletion
from django.db import migrations, models
from decimal import Decimal
class Migration(migrations.Migration):
dependencies = [
("jobs", "0001_initial"),
]
operations = [
migrations.CreateModel(
name="GeocodeLocationLookup",
fields=[
("id", models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name="ID")),
("created_at", models.DateTimeField(auto_now_add=True)),
("updated_at", models.DateTimeField(auto_now=True)),
("source_name", models.CharField(max_length=120)),
("source_version", models.CharField(max_length=80)),
("source_license_name", models.CharField(blank=True, max_length=160)),
("source_license_url", models.URLField(blank=True, max_length=500)),
("source_metadata", models.JSONField(blank=True, default=dict)),
("query_kind", models.CharField(choices=[("postal", "Postcode"), ("municipality", "Gemeente")], max_length=12)),
("query_value", models.CharField(max_length=200, db_index=True)),
("postal_code", models.CharField(db_index=True, max_length=12)),
("municipality", models.CharField(db_index=True, max_length=200)),
("region", models.CharField(blank=True, max_length=160)),
(
"latitude",
models.DecimalField(decimal_places=6, max_digits=9),
),
(
"longitude",
models.DecimalField(decimal_places=6, max_digits=9),
),
("confidence", models.DecimalField(decimal_places=2, default=Decimal("0.85"), max_digits=3)),
],
options={
"ordering": ["query_kind", "query_value", "municipality"],
},
),
migrations.AddIndex(
model_name="geocodelocationlookup",
index=models.Index(fields=["query_kind", "query_value"], name="geocode_lookup_kind_query_idx"),
),
migrations.AddIndex(
model_name="geocodelocationlookup",
index=models.Index(fields=["source_name", "source_version"], name="geocode_lookup_source_idx"),
),
migrations.AddConstraint(
model_name="geocodelocationlookup",
constraint=models.UniqueConstraint(
fields=[
"source_name",
"source_version",
"query_kind",
"query_value",
"postal_code",
"municipality",
],
name="unique_geocode_lookup_row",
),
),
]