# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-07-08 20:18
from __future__ import unicode_literals

import django.contrib.postgres.fields.jsonb
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Block',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hash_anterior', models.CharField(default=b'', max_length=255)),
                ('hash_block', models.CharField(default=b'', max_length=255)),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
            ],
        ),
        migrations.CreateModel(
            name='Medication',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.CharField(blank=True, default=b'', max_length=255)),
                ('presentation', models.CharField(blank=True, max_length=255)),
                ('instructions', models.TextField(blank=True, default=b'', max_length=10000)),
                ('frequency', models.CharField(blank=True, default=b'', max_length=255)),
                ('dose', models.CharField(blank=True, default=b'', max_length=255)),
                ('bought', models.BooleanField(default=False)),
                ('drug_upc', models.CharField(blank=True, db_index=True, default=b'', max_length=255)),
                ('public_key', models.CharField(default=b'', max_length=255)),
            ],
        ),
        migrations.CreateModel(
            name='Prescription',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('public_key', models.CharField(default=b'', max_length=2000)),
                ('private_key', models.CharField(default=b'', max_length=2000)),
                ('medic_name', models.CharField(blank=True, default=b'', max_length=255)),
                ('medic_cedula', models.CharField(blank=True, default=b'', max_length=255)),
                ('medic_hospital', models.CharField(blank=True, default=b'', max_length=255)),
                ('patient_name', models.CharField(blank=True, default=b'', max_length=255)),
                ('patient_age', models.CharField(blank=True, default=b'', max_length=255)),
                ('diagnosis', models.CharField(default=b'', max_length=255)),
                ('timestamp', models.DateTimeField(auto_now_add=True, db_index=True)),
                ('location', models.CharField(blank=True, default=b'', max_length=255)),
                ('raw_msg', models.TextField(default=b'', max_length=10000)),
                ('location_lat', models.FloatField(default=0)),
                ('location_lon', models.FloatField(default=0)),
                ('details', models.TextField(blank=True, default=b'', max_length=10000)),
                ('extras', models.TextField(blank=True, default=b'', max_length=10000)),
                ('bought', models.BooleanField(default=False)),
                ('signature', models.CharField(default=b'', max_length=255)),
                ('data', django.contrib.postgres.fields.jsonb.JSONField()),
            ],
        ),
        migrations.AddField(
            model_name='medication',
            name='prescription',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='medications', to='blockchain.Prescription'),
        ),
    ]
