kumify/gpslog/migrations/0001_initial.py

55 lines
2.5 KiB
Python
Raw Normal View History

# Generated by Django 4.1.1 on 2022-09-09 16:07
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import uuid
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.DecimalField(blank=True, decimal_places=2, max_digits=5, null=True)),
('accuracy', models.DecimalField(blank=True, decimal_places=32, max_digits=64, null=True)),
('speed', models.DecimalField(blank=True, decimal_places=32, max_digits=64, null=True)),
('bearing', models.DecimalField(blank=True, decimal_places=61, max_digits=64, 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')),
],
),
]