<reponame>yellowjaguar5/lnldb
# -*- coding: utf-8 -*-
# Generated by Django 1.11.29 on 2020-06-08 08:15
from __future__ import unicode_literals

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


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
    ]

    operations = [
        migrations.CreateModel(
            name='Laptop',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=20)),
                ('description', models.TextField(blank=True)),
                ('api_key_hash', models.CharField(db_index=True, help_text='SHA-256 hash of the API key that the laptop uses when it changes its passwords', max_length=64, verbose_name='API key hash')),
                ('user_password', models.CharField(max_length=25)),
                ('admin_password', models.CharField(max_length=25)),
                ('retired', models.BooleanField(default=False)),
            ],
            options={
                'permissions': (('view_laptop_details', 'View details of a laptop'), ('view_laptop_history', 'View password retrieval history for a laptop'), ('retrieve_user_password', 'Retrieve the user password for a laptop'), ('retrieve_admin_password', 'Retrieve the admin password for a laptop')),
            },
        ),
        migrations.CreateModel(
            name='LaptopPasswordRetrieval',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('admin', models.BooleanField()),
                ('laptop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='password_retrievals', to='devices.Laptop')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.CreateModel(
            name='LaptopPasswordRotation',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('timestamp', models.DateTimeField(auto_now_add=True)),
                ('laptop', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='password_rotations', to='devices.Laptop')),
            ],
        ),
    ]
