initial commit
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
# Generated by Django 6.1.1 on 2026-09-26 13:34
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
initial = True
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Event',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('audio_file', models.FileField(upload_to='fireworks_audio/%Y/%m/%d')),
|
||||
('original_filename', models.CharField(max_length=255)),
|
||||
('classifier_response', models.JSONField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
('approved_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Event',
|
||||
'verbose_name_plural': 'Events',
|
||||
'ordering': ['-created_at'],
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
migrations.CreateModel(
|
||||
name='PendingEvent',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('audio_file', models.FileField(upload_to='fireworks_audio/%Y/%m/%d')),
|
||||
('original_filename', models.CharField(max_length=255)),
|
||||
('classifier_response', models.JSONField()),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'verbose_name': 'Pending event',
|
||||
'verbose_name_plural': 'Pending',
|
||||
'ordering': ['-created_at'],
|
||||
'abstract': False,
|
||||
},
|
||||
),
|
||||
]
|
||||
@@ -0,0 +1,40 @@
|
||||
# Generated by Django 6.1.1 on 2026-09-26 14:16
|
||||
|
||||
import django.db.models.deletion
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('fireworks_detect', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Sensor',
|
||||
fields=[
|
||||
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
|
||||
('name', models.CharField(help_text='A recognisable device name, e.g. Garden ESP32.', max_length=100, unique=True)),
|
||||
('is_active', models.BooleanField(default=True)),
|
||||
('token_prefix', models.CharField(blank=True, editable=False, max_length=15)),
|
||||
('token_hash', models.CharField(blank=True, editable=False, max_length=256)),
|
||||
('last_heartbeat', models.DateTimeField(blank=True, editable=False, null=True)),
|
||||
('last_submission', models.DateTimeField(blank=True, editable=False, null=True)),
|
||||
('created_at', models.DateTimeField(auto_now_add=True)),
|
||||
],
|
||||
options={
|
||||
'ordering': ['name'],
|
||||
},
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='event',
|
||||
name='sensor',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_records', to='fireworks_detect.sensor'),
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='pendingevent',
|
||||
name='sensor',
|
||||
field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='%(class)s_records', to='fireworks_detect.sensor'),
|
||||
),
|
||||
]
|
||||
Binary file not shown.
BIN
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user