# Generated by Django 2.0.9 on 2019-07-14 08:42

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('device', '0001_initial'),
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Block',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
            ],
        ),
        migrations.CreateModel(
            name='BlockChain',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('Block_chain', models.ManyToManyField(to='local.Block')),
            ],
        ),
        migrations.CreateModel(
            name='BlockHeader',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('hash', models.CharField(max_length=100)),
            ],
        ),
        migrations.CreateModel(
            name='PolicyHeader',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('requested_action', models.CharField(max_length=100)),
                ('action', models.PositiveSmallIntegerField(choices=[(1, 'Genesis'), (2, 'Store'), (3, 'Access'), (4, 'Monitor'), (5, 'Remove')])),
                ('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='device.Device')),
                ('requester', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='Transactions',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('transaction_number', models.IntegerField()),
                ('transaction_type', models.PositiveSmallIntegerField(choices=[(1, 'Genesis'), (2, 'Store'), (3, 'Access'), (4, 'Monitor'), (5, 'Remove')])),
                ('device', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.CASCADE, to='device.Device')),
                ('prev_transaction', models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.PROTECT, to='local.Transactions')),
            ],
        ),
        migrations.AddField(
            model_name='block',
            name='Block_header',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='local.BlockHeader'),
        ),
        migrations.AddField(
            model_name='block',
            name='Policy_header',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='local.PolicyHeader'),
        ),
        migrations.AddField(
            model_name='block',
            name='Transactions',
            field=models.ManyToManyField(to='local.Transactions'),
        ),
    ]
