# Generated by Django 2.2.10 on 2020-04-19 13:08

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


class Migration(migrations.Migration):

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('majora2', '0054_auto_20200411_1013'),
    ]

    operations = [
        migrations.CreateModel(
            name='PublishedArtifactGroup',
            fields=[
                ('majoraartifactgroup_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='majora2.MajoraArtifactGroup')),
                ('published_name', models.CharField(max_length=128)),
                ('published_version', models.PositiveIntegerField()),
                ('published_date', models.DateField()),
                ('is_draft', models.BooleanField(default=False)),
                ('is_latest', models.BooleanField(default=False)),
                ('owner', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, to=settings.AUTH_USER_MODEL)),
            ],
            bases=('majora2.majoraartifactgroup',),
        ),
        migrations.AddConstraint(
            model_name='publishedartifactgroup',
            constraint=models.UniqueConstraint(fields=('published_name', 'is_latest'), name='is_only_published'),
        ),
    ]
