backend/exhauster_analytics/analytics/migrations/0001_initial.py

142 lines
4.7 KiB
Python
Raw Normal View History

2023-02-18 23:51:02 +03:00
# Generated by Django 4.1.7 on 2023-02-17 09:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Exgauster",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("number", models.IntegerField(unique=True)),
("name", models.CharField(max_length=20)),
("installed", models.DateField()),
],
),
migrations.CreateModel(
name="Record",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("received", models.DateTimeField(auto_now_add=True)),
("timestamp", models.DateTimeField()),
("offset", models.IntegerField(unique=True)),
("message", models.JSONField(null=True)),
],
),
migrations.CreateModel(
name="ExgausterSignalDescription",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("place_x", models.IntegerField()),
("place_y", models.IntegerField()),
(
"type",
models.CharField(
choices=[("analog", "ANALOG"), ("digital", "DIGITAL")],
max_length=7,
),
),
("comment", models.CharField(blank=True, max_length=200)),
("Exgauster", models.IntegerField()),
("active", models.BooleanField(default=True)),
],
options={
"unique_together": {("place_x", "place_y")},
},
),
migrations.CreateModel(
name="ExgausterSignal",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("item", models.CharField(max_length=200)),
("characteristics", models.CharField(max_length=200)),
("characteristics_description", models.CharField(max_length=200)),
("item_name", models.CharField(max_length=200)),
(
"Exgauster",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="signals",
to="analytics.exgauster",
),
),
(
"signal",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
to="analytics.exgaustersignaldescription",
),
),
],
),
migrations.CreateModel(
name="ExgausterRecordSignal",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("value", models.FloatField()),
(
"record",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="signals",
to="analytics.record",
),
),
(
"signal",
models.ForeignKey(
on_delete=django.db.models.deletion.CASCADE,
related_name="records",
to="analytics.exgaustersignal",
),
),
],
),
]