# Generated by Django 3.1.6 on 2021-02-10 22:20

import django.core.files.storage
import django.core.validators
from django.db import migrations, models
import django.db.models.deletion


class Migration(migrations.Migration):

    initial = True

    dependencies = [
    ]

    operations = [
        migrations.CreateModel(
            name='Config',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9a-zA-Z._-]+$', 'Only alphanumeric characters, dot ".", underscore "_", and hyphen "-" symbols are allowed.')])),
                ('template', models.TextField()),
                ('description', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Vendor',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True)),
                ('description', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='ZtpScript',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, unique=True, validators=[django.core.validators.RegexValidator('^[0-9a-zA-Z._-]+$', 'Only alphanumeric characters, dot ".", underscore "_", and hyphen "-" symbols are allowed.')])),
                ('render_template', models.BooleanField(default=True)),
                ('use_parameters', models.BooleanField(default=True)),
                ('accept_query_string', models.BooleanField(default=False)),
                ('priority_query_string_over_arguments', models.BooleanField(default=False)),
                ('template', models.TextField()),
                ('description', models.TextField(blank=True)),
            ],
        ),
        migrations.CreateModel(
            name='Platform',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50)),
                ('description', models.TextField(blank=True)),
                ('vendor', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='platforms', to='ztp.vendor')),
            ],
            options={
                'unique_together': {('vendor', 'name')},
            },
        ),
        migrations.CreateModel(
            name='Firmware',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('file', models.FileField(storage=django.core.files.storage.FileSystemStorage(base_url='firmwares/', location='firmwares/'), unique=True, upload_to='')),
                ('description', models.TextField(blank=True)),
                ('filesize', models.IntegerField()),
                ('md5_hash', models.CharField(max_length=32)),
                ('sha512_hash', models.CharField(max_length=128)),
                ('platform', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='firmwares', to='ztp.platform')),
            ],
        ),
        migrations.CreateModel(
            name='ZtpParameter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, validators=[django.core.validators.RegexValidator('^[a-zA-Z_][0-9a-zA-Z._-]*$', 'Only alphanumeric characters, dot ".", underscore "_", and hyphen "-" symbols are allowed.')])),
                ('value', models.CharField(blank=True, max_length=200)),
                ('ztpScript', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parameters', to='ztp.ztpscript')),
            ],
            options={
                'unique_together': {('ztpScript', 'name')},
            },
        ),
        migrations.CreateModel(
            name='ConfigParameter',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=50, validators=[django.core.validators.RegexValidator('^[a-zA-Z_][0-9a-zA-Z._-]*$', 'Only alphanumeric characters, dot ".", underscore "_", and hyphen "-" symbols are allowed.')])),
                ('data', models.TextField(blank=True)),
                ('config', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='parameters', to='ztp.config')),
            ],
            options={
                'unique_together': {('config', 'name')},
            },
        ),
    ]
