53 lines
1.8 KiB
Python
53 lines
1.8 KiB
Python
# Generated manually for HQ city registry scaffold
|
|
|
|
from django.db import migrations, models
|
|
|
|
|
|
class Migration(migrations.Migration):
|
|
initial = True
|
|
|
|
dependencies = []
|
|
|
|
operations = [
|
|
migrations.CreateModel(
|
|
name="CitySite",
|
|
fields=[
|
|
("city_site_id", models.BigAutoField(primary_key=True, serialize=False)),
|
|
(
|
|
"code",
|
|
models.SlugField(
|
|
help_text="Stable id, e.g. sukawarna",
|
|
max_length=64,
|
|
unique=True,
|
|
),
|
|
),
|
|
("name", models.CharField(max_length=120)),
|
|
(
|
|
"api_base_url",
|
|
models.URLField(
|
|
help_text="City API root including /api/v1, e.g. https://site.example/api/v1",
|
|
max_length=255,
|
|
),
|
|
),
|
|
(
|
|
"api_key",
|
|
models.CharField(
|
|
blank=True,
|
|
help_text="X-API-Key for pulling from the city API (keep server-side only)",
|
|
max_length=255,
|
|
),
|
|
),
|
|
("is_active", models.BooleanField(default=True)),
|
|
("last_synced_at", models.DateTimeField(blank=True, null=True)),
|
|
("last_sync_status", models.CharField(blank=True, default="", max_length=32)),
|
|
("last_sync_message", models.TextField(blank=True, default="")),
|
|
("created_at", models.DateTimeField(auto_now_add=True)),
|
|
("updated_at", models.DateTimeField(auto_now=True)),
|
|
],
|
|
options={
|
|
"db_table": "city_sites",
|
|
"ordering": ["name"],
|
|
},
|
|
),
|
|
]
|