# Generated by Django 3.2.12 on 2024-01-12 04:17

from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    dependencies = [
        ('em', '0010_auto_20240110_1232'),
        ('enp', '0001_initial'),
    ]

    operations = [
        migrations.RunSQL(
            sql=[(
                """
CREATE TABLE public.enp_envdata (
    "time" timestamp NOT NULL,
    "equipment_id" text NOT NULL,
    "is_online" bool NOT NULL,
    "is_runing" bool NOT NULL,
    "dust_rtd" decimal,
    "dust_zs" decimal,
    "temperature" decimal,
    "pressure" decimal,
    "speed" decimal,
    "humidity" decimal,
    "flux" decimal,
    "pm25" decimal,
    "pm10" decimal,
    "tsp" decimal,
    "wind_speed" decimal,
    "so2_rtd" decimal,
    "so2_zs" decimal,
    "nox_rtd" decimal,
    "nox_zs" decimal,
    "o2" decimal,
    CONSTRAINT enp_envdata_pkey PRIMARY KEY (time, equipment_id)
);
SELECT create_hypertable('enp_envdata', 'time');
                """
            )],
            reverse_sql=[
                "DROP TABLE IF EXISTS public.enp_envdata;"
            ]
        )
    ]
