text: # Generated by Django 2.2.3 on 2019-10-21 08:40
  
  from django.conf import settings
  import django.contrib.postgres.fields.jsonb
  from django.db import migrations, models
  import django.db.models.deletion
  import django.utils.timezone
  
  
  class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
          ('devices', '0001_initial'),
          migrations.swappable_dependency(settings.AUTH_USER_MODEL),
          ('fcm_django', '0004_auto_20181128_1642'),
      ]
  
      operations = [
          migrations.CreateModel(
              name='Measurement',
              fields=[
                  ('sample_id', models.IntegerField(help_text='Measurement ID', primary_key=True, serialize=False)),
                  ('laboratory', models.CharField(blank=True, help_text='Name of laboratory that is doing measurement.', max_length=127, null=True)),
                  ('food_type', models.CharField(blank=True, help_text='Name of food type that is tested.', max_length=127, null=True)),
                  ('food_subtype', models.CharField(blank=True, help_text='Name of food subtype that is tested if exists.', max_length=127, null=True)),
                  ('use_case', models.CharField(blank=True, help_text='Name of use case.', max_length=127, null=True)),
                  ('use_case_sample_id', models.CharField(blank=True, help_text='Determine id for particular use case.', max_length=127, null=True)),
                  ('granularity', models.CharField(blank=True, help_text='Granularity of food samples.', max_length=127, null=True)),
                  ('mycotoxins', models.CharField(blank=True, help_text='Toxic compounds that are naturally produced by certain types of moulds', max_length=127, null=True)),
                  ('aflatoxin_name', models.CharField(blank=True, help_text='Name of poisonous carcinogens that are produced by certain molds', max_length=127, null=True)),
                  ('aflatoxin_unit', models.CharField(blank=True, help_text='Unit of poisonous carcinogens that are produced by certain molds', max_length=127, null=True)),
                  ('aflatoxin_value', models.CharField(blank=True, help_text='Value of poisonous carcinogens that are produced by certain molds', max_length=127, null=True)),
                  ('temperature', models.IntegerField(blank=True, help_text='Temperature of environment where sample was kept.', null=True)),
                  ('temperature_exposure_hours', models.CharField(blank=True, help_text='How long sample was on certain temperature in hours', max_length=127, null=True)),
                  ('microbiological_id', models.CharField(blank=True, help_text='ID of microbiological sample.', max_length=127, null=True)),
                  ('microbiological_unit', models.CharField(blank=True, help_text='Unit used to estimate the number of viable bacteria or fungal cells in a sample.', max_length=127, null=True)),
                  ('microbiological_value', models.CharField(blank=True, help_text='Number of viable bacteria or fungal cells in a sample.', max_length=127, null=True)),
                  ('other_species', models.CharField(blank=True, help_text='Other species that can be in sample.', max_length=127, null=True)),
                  ('adulteration_id', models.CharField(blank=True, help_text='ID of test for fake sample.', max_length=127, null=True)),
                  ('alcohol_label', models.CharField(blank=True, help_text='Type of alcohol that is tested.', max_length=127, null=True)),
                  ('authentic', models.CharField(blank=True, help_text='Is tested alcohol authentic or not.', max_length=127, null=True)),
                  ('purity_smp', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('low_value_filler', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('nitrogen_enhancer', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('hazard_one_name', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('hazard_one_pct', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('hazard_two_name', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('hazard_two_pct', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('diluted_pct', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('package', models.CharField(blank=True, help_text='Additional parameter for food adulteration.', max_length=127, null=True)),
                  ('adulterated', models.CharField(blank=True, help_text='Check if sample is adulterated or not', max_length=127, null=True)),
                  ('configuration', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Configuration of phasma device.', null=True)),
                  ('vis', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Visible spectrometer data.', null=True)),
                  ('nir', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Near-infrared spectrometer data.', null=True)),
                  ('fluo', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Fluorescence spectrometer data.', null=True)),
                  ('image', models.ImageField(blank=True, null=True, upload_to='images/food')),
                  ('white_reference_time', models.CharField(blank=True, help_text='Time of white reference measurement.', max_length=127, null=True)),
                  ('date_created', models.DateTimeField(default=django.utils.timezone.now, help_text='Date when measurement was made.', verbose_name='date created')),
                  ('date_updated', models.DateTimeField(auto_now=True, help_text='Date when measurement was updated.', verbose_name='date updated')),
                  ('mobile', models.ForeignKey(help_text='ID of mobile device form where measurement is sent.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='measurements', to='fcm_django.FCMDevice')),
                  ('owner', models.ForeignKey(help_text='User that did measurement.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='measurements', to=settings.AUTH_USER_MODEL)),
                  ('phasma_device', models.ForeignKey(help_text='ID of phasma device that did measurement.', null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='measurements', to='devices.PhasmaDevice')),
              ],
              options={
                  'ordering': ('-date_created',),
              },
          ),
          migrations.CreateModel(
              name='Result',
              fields=[
                  ('measurement', models.OneToOneField(on_delete=django.db.models.deletion.CASCADE, primary_key=True, related_name='result', serialize=False, to='measurements.Measurement')),
                  ('data', django.contrib.postgres.fields.jsonb.JSONField(blank=True, help_text='Result of trained measurement.', null=True)),
                  ('date_created', models.DateTimeField(default=django.utils.timezone.now, help_text='Date when result was created.', verbose_name='date created')),
              ],
              options={
                  'ordering': ('-date_created',),
              },
          ),
          migrations.CreateModel(
              name='Image',
              fields=[
                  ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                  ('camera', models.ImageField(blank=True, null=True, upload_to='images/food')),
                  ('name', models.CharField(default='phasma_default_image_name', max_length=254)),
                  ('measurement', models.ForeignKey(null=True, on_delete=django.db.models.deletion.CASCADE, related_name='images', to='measurements.Measurement')),
              ],
          ),
      ]
  