kumify/gpslog/migrations/0001_initial.py
Kumi a6025dee31
fix: Switches DecimalFields to FloatFields in GPSPoint
Converts battery, accuracy, speed, and bearing fields from
DecimalField to FloatField in GPSPoint model for improved
performance and simplified operations. Updates migration to
reflect these changes, ensuring consistency across the database.
2024-11-18 06:42:36 +01:00

100 lines
3.4 KiB
Python

# Generated by Django 5.0.6 on 2024-11-18 05:40
import django.contrib.gis.db.models.fields
import django.db.models.deletion
import uuid
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.CreateModel(
name="GPSTrack",
fields=[
(
"id",
models.UUIDField(
default=uuid.uuid4, primary_key=True, serialize=False
),
),
(
"user",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to=settings.AUTH_USER_MODEL,
),
),
],
),
migrations.CreateModel(
name="GPSToken",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("name", models.CharField(blank=True, max_length=128, null=True)),
("token", models.UUIDField(default=uuid.uuid4)),
("read", models.BooleanField(default=False)),
("write", models.BooleanField(default=False)),
("history", models.BooleanField(default=False)),
(
"track",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="gpslog.gpstrack",
),
),
],
),
migrations.CreateModel(
name="GPSPoint",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("point", django.contrib.gis.db.models.fields.PointField(srid=4326)),
("timestamp", models.DateTimeField()),
("battery", models.FloatField(blank=True, null=True)),
("accuracy", models.FloatField(blank=True, null=True)),
("speed", models.FloatField(blank=True, null=True)),
("bearing", models.FloatField(blank=True, null=True)),
("satellites", models.IntegerField(blank=True, null=True)),
("user_agent", models.TextField(blank=True, null=True)),
(
"token",
models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="gpslog.gpstoken",
),
),
(
"track",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="gpslog.gpstrack",
),
),
],
),
]