<filename>miningstatistic/miner/migrations/0001_initial.py
# Generated by Django 2.1.1 on 2018-09-18 08:03

import core.validators
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='Miner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31)),
                ('version', models.CharField(max_length=31)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=63, unique=True)),
                ('description', models.CharField(blank=True, max_length=255)),
            ],
            options={
                'verbose_name': 'Supported miners',
                'ordering': ['name', 'version'],
            },
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=31)),
                ('request', models.TextField(max_length=255, validators=[core.validators.validate_json])),
                ('response', models.TextField(blank=True, help_text='Response template', validators=[core.validators.validate_json])),
                ('description', models.CharField(blank=True, max_length=255)),
                ('miner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='miner.Miner')),
            ],
            options={
                'verbose_name': 'Supported requests',
                'ordering': ['miner', 'name'],
            },
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31, unique=True)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=31, unique=True)),
                ('host', models.GenericIPAddressField(validators=[django.core.validators.validate_ipv46_address])),
                ('port', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)])),
                ('description', models.CharField(blank=True, max_length=255)),
                ('miner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='servers', to='miner.Miner')),
            ],
            options={
                'verbose_name': 'Mining servers',
                'ordering': ['name'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='miner',
            unique_together={('name', 'version')},
        ),
        migrations.AlterUniqueTogether(
            name='request',
            unique_together={('miner', 'name')},
        ),
    ]

<filename>miningstatistic/miner/migrations/0001_initial.py
# Generated by Django 2.1.1 on 2018-09-18 08:03

import core.validators
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='Miner',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31)),
                ('version', models.CharField(max_length=31)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=63, unique=True)),
                ('description', models.CharField(blank=True, max_length=255)),
            ],
            options={
                'verbose_name': 'Supported miners',
                'ordering': ['name', 'version'],
            },
        ),
        migrations.CreateModel(
            name='Request',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=31)),
                ('request', models.TextField(max_length=255, validators=[core.validators.validate_json])),
                ('response', models.TextField(blank=True, help_text='Response template', validators=[core.validators.validate_json])),
                ('description', models.CharField(blank=True, max_length=255)),
                ('miner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='requests', to='miner.Miner')),
            ],
            options={
                'verbose_name': 'Supported requests',
                'ordering': ['miner', 'name'],
            },
        ),
        migrations.CreateModel(
            name='Server',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=31, unique=True)),
                ('slug', models.SlugField(editable=False, help_text='A label for URL config.', max_length=31, unique=True)),
                ('host', models.GenericIPAddressField(validators=[django.core.validators.validate_ipv46_address])),
                ('port', models.PositiveIntegerField(default=1, validators=[django.core.validators.MinValueValidator(0), django.core.validators.MaxValueValidator(65535)])),
                ('description', models.CharField(blank=True, max_length=255)),
                ('miner', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='servers', to='miner.Miner')),
            ],
            options={
                'verbose_name': 'Mining servers',
                'ordering': ['name'],
            },
        ),
        migrations.AlterUniqueTogether(
            name='miner',
            unique_together={('name', 'version')},
        ),
        migrations.AlterUniqueTogether(
            name='request',
            unique_together={('miner', 'name')},
        ),
    ]

# Generated by Django 2.1.1 on 2018-09-18 08:03