# Generated by Django 4.1.2 on 2023-01-19 20:01

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django_extensions.db.fields
import sphinx_hosting.validators


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('sphinxhostingcore', '0005_orig_global_toc'),
    ]

    operations = [
        migrations.CreateModel(
            name='Classifier',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(help_text='The classifier spec for this classifier, e.g. "Language :: Python"', max_length=255, unique=True, verbose_name='Classifier Name')),
            ],
            options={
                'verbose_name': 'classifier',
                'verbose_name_plural': 'classifiers',
            },
        ),
        migrations.RemoveField(
            model_name='version',
            name='global_toc',
        ),
        migrations.AlterField(
            model_name='project',
            name='machine_name',
            field=models.SlugField(help_text='Must be unique.  Set this to the slugified value of "project" in Sphinx\'s. conf.py', unique=True, verbose_name='Machine Name'),
        ),
        migrations.AlterField(
            model_name='version',
            name='project',
            field=models.ForeignKey(help_text='The Project to which this Version belongs', on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='sphinxhostingcore.project'),
        ),
        migrations.AlterField(
            model_name='version',
            name='sphinx_version',
            field=models.CharField(blank=True, default=None, help_text='The version of Sphinx used to create this documentation set', max_length=64, null=True, verbose_name='Sphinx Version'),
        ),
        migrations.AlterField(
            model_name='version',
            name='version',
            field=models.CharField(help_text='The version number for this release of the Project', max_length=64, verbose_name='Version'),
        ),
        migrations.CreateModel(
            name='ProjectPermissionGroup',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created', django_extensions.db.fields.CreationDateTimeField(auto_now_add=True, verbose_name='created')),
                ('modified', django_extensions.db.fields.ModificationDateTimeField(auto_now=True, verbose_name='modified')),
                ('name', models.CharField(help_text='The name for this permission group', max_length=100, unique=True, verbose_name='Permission Group Name')),
                ('description', models.CharField(blank=True, help_text='A brief description of this permission group', max_length=256, null=True, validators=[sphinx_hosting.validators.NoHTMLValidator()], verbose_name='Brief Description')),
                ('users', models.ManyToManyField(related_name='project_permission_groups', to=settings.AUTH_USER_MODEL)),
            ],
            options={
                'verbose_name': 'project permission group',
                'verbose_name_plural': 'project permission groups',
            },
        ),
        migrations.AddField(
            model_name='project',
            name='classifiers',
            field=models.ManyToManyField(related_name='projects', to='sphinxhostingcore.classifier'),
        ),
        migrations.AddField(
            model_name='project',
            name='permission_groups',
            field=models.ManyToManyField(related_name='projects', to='sphinxhostingcore.projectpermissiongroup'),
        ),
    ]
