38 lines
1.4 KiB
Python
38 lines
1.4 KiB
Python
|
|
# Generated by Django 5.1.15 on 2026-03-23 18:48
|
||
|
|
|
||
|
|
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='Sensor',
|
||
|
|
fields=[
|
||
|
|
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||
|
|
('uuid_sensor', models.UUIDField(db_index=True, default=uuid.uuid4, editable=False, unique=True)),
|
||
|
|
('name', models.CharField(max_length=255)),
|
||
|
|
('is_active', models.BooleanField(default=True)),
|
||
|
|
('specifications', models.JSONField(blank=True, default=dict)),
|
||
|
|
('power_source', models.JSONField(blank=True, default=dict)),
|
||
|
|
('customized_sensors', models.JSONField(blank=True, default=dict)),
|
||
|
|
('created_at', models.DateTimeField(auto_now_add=True)),
|
||
|
|
('updated_at', models.DateTimeField(auto_now=True)),
|
||
|
|
('owner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='sensors', to=settings.AUTH_USER_MODEL)),
|
||
|
|
],
|
||
|
|
options={
|
||
|
|
'db_table': 'sensors',
|
||
|
|
'ordering': ['-created_at'],
|
||
|
|
},
|
||
|
|
),
|
||
|
|
]
|