text: # Generated by Django 3.0.2 on 2020-01-26 15:16
  
  import django.contrib.postgres.fields.jsonb
  from django.db import migrations, models
  import django.utils.timezone
  import hefesto_core.models
  
  
  def forwards_func(apps, schema_editor):
      try:
          from django.contrib.auth.models import User
          User.objects.create_superuser("admin", "admin@example.com", "admin", id=1)
      except:  # noqa
          pass
  
  
  def reverse_func(apps, schema_editor):
      try:
          from django.contrib.auth.models import User
          User.objects.filter(id=1).delete()
      except:  # noqa
          pass
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('auth', '0011_update_proxy_permissions'),
      ]
  
      operations = [
          migrations.RunPython(forwards_func, reverse_func),
          migrations.CreateModel(
              name='DeviceConfiguration',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('hefesto_id', models.CharField(blank=True, help_text='Identificador unico para usar en el envio de datos.\nSi se deja en blanco, se usuara el serial de la CPU.', max_length=100)),
              ],
              options={
                  'abstract': False,
              },
          ),
          migrations.CreateModel(
              name='Task',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('name', models.CharField(max_length=50)),
                  ('command', models.CharField(max_length=1024)),
                  ('cron_expression', models.CharField(max_length=50, validators=[hefesto_core.models.validate_cron])),
                  ('enable', models.BooleanField(default=True)),
                  ('created', models.DateTimeField(auto_now_add=True)),
                  ('updated', models.DateTimeField(auto_now=True)),
              ],
          ),
          migrations.CreateModel(
              name='TimeSerie',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('time', models.DateTimeField(default=django.utils.timezone.now)),
                  ('name', models.CharField(max_length=50)),
                  ('value', models.FloatField()),
                  ('plugin', models.CharField(max_length=50)),
                  ('context', django.contrib.postgres.fields.jsonb.JSONField(blank=True, default=dict, null=True)),
                  ('exported', models.NullBooleanField(default=False)),
                  ('created', models.DateTimeField(auto_now_add=True)),
                  ('updated', models.DateTimeField(auto_now=True)),
              ],
          ),
          migrations.AddIndex(
              model_name='timeserie',
              index=models.Index(fields=['time', 'exported'], name='hefesto_cor_time_4d37ff_idx'),
          ),
          migrations.AddIndex(
              model_name='timeserie',
              index=models.Index(fields=['plugin', 'name', 'time'], name='hefesto_cor_plugin_9ed828_idx'),
          ),
      ]
  