Skip to content

Commit

Permalink
feat(Django): add model init migrations (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphodn authored Sep 11, 2024
1 parent b25146d commit 8aabad6
Show file tree
Hide file tree
Showing 10 changed files with 1,089 additions and 0 deletions.
69 changes: 69 additions & 0 deletions open_prices/locations/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# Generated by Django 5.1 on 2024-09-03 16:14

import django.utils.timezone
from django.db import migrations, models


class Migration(migrations.Migration):
initial = True

operations = [
migrations.CreateModel(
name="Location",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("osm_id", models.PositiveBigIntegerField()),
(
"osm_type",
models.CharField(
choices=[
("NODE", "NODE"),
("WAY", "WAY"),
("RELATION", "RELATION"),
],
max_length=10,
),
),
("osm_name", models.CharField(blank=True, null=True)),
("osm_display_name", models.CharField(blank=True, null=True)),
("osm_tag_key", models.CharField(blank=True, null=True)),
("osm_tag_value", models.CharField(blank=True, null=True)),
("osm_address_postcode", models.CharField(blank=True, null=True)),
("osm_address_city", models.CharField(blank=True, null=True)),
("osm_address_country", models.CharField(blank=True, null=True)),
("osm_address_country_code", models.CharField(blank=True, null=True)),
(
"osm_lat",
models.DecimalField(
blank=True, decimal_places=7, max_digits=11, null=True
),
),
(
"osm_lon",
models.DecimalField(
blank=True, decimal_places=7, max_digits=11, null=True
),
),
(
"price_count",
models.PositiveIntegerField(blank=True, default=0, null=True),
),
("created", models.DateTimeField(default=django.utils.timezone.now)),
("updated", models.DateTimeField(auto_now=True)),
],
options={
"verbose_name": "Location",
"verbose_name_plural": "Locations",
"db_table": "locations",
"unique_together": {("osm_id", "osm_type")},
},
),
]
Empty file.
Loading

0 comments on commit 8aabad6

Please sign in to comment.