# Generated by Django 4.1.7 on 2023-03-07 11:12

import django.core.validators
from django.db import migrations, models
import django.db.models.deletion
import modelcluster.fields
import swatchbook.blocks
import wagtail.blocks.struct_block
import wagtail.fields
import wagtail_attachments.models.mixins
import wagtail_block_model_field.fields


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ('wagtail_attachments', '0002_add_attachment_roles'),
    ]

    operations = [
        migrations.CreateModel(
            name='Colour',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9-]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores, digits or hyphens.')])),
                ('definition', wagtail_block_model_field.fields.BlockModelField(swatchbook.blocks.ResponsiveColourBlock(required=True), wagtail.blocks.struct_block.StructValue)),
            ],
        ),
        migrations.CreateModel(
            name='FontAlias',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('alias', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9-]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores, digits or hyphens.')])),
            ],
            options={
                'verbose_name': 'Font Alias',
                'verbose_name_plural': 'Font Aliases',
            },
        ),
        migrations.CreateModel(
            name='FontFace',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('sort_order', models.IntegerField(blank=True, editable=False, null=True)),
                ('style', models.CharField(default='normal', max_length=128)),
                ('weight', models.CharField(default='400', max_length=128)),
            ],
            options={
                'verbose_name': 'Font Face',
                'verbose_name_plural': 'Font Faces',
            },
            bases=(wagtail_attachments.models.mixins.StorageMixin, wagtail_attachments.models.mixins.AttachableMixin, models.Model),
        ),
        migrations.CreateModel(
            name='FontFaceAttachment',
            fields=[
                ('modelattachment_ptr', models.OneToOneField(auto_created=True, on_delete=django.db.models.deletion.CASCADE, parent_link=True, primary_key=True, serialize=False, to='wagtail_attachments.modelattachment')),
            ],
            options={
                'abstract': False,
            },
            bases=('wagtail_attachments.modelattachment',),
        ),
        migrations.CreateModel(
            name='FontFamily',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9-]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores, digits or hyphens.')])),
            ],
            options={
                'verbose_name': 'Font Family',
                'verbose_name_plural': 'Font Families',
            },
        ),
        migrations.CreateModel(
            name='MediaQuery',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('active', models.BooleanField(default=True)),
                ('identifier', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores or digits.')])),
                ('definition', models.TextField(default='all')),
                ('priority', models.IntegerField(default='0')),
            ],
            options={
                'verbose_name': 'Media Query',
                'verbose_name_plural': 'Media Queries',
            },
        ),
        migrations.CreateModel(
            name='StylesheetVariable',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('identifier', models.CharField(default='', max_length=128, validators=[django.core.validators.RegexValidator('^[A-Za-z_][A-Za-z_0-9-]*$', code='invalid_identifier', message='A valid identifier starts with an alphanumeric letter or underscore and contains only alphanumeric letters, underscores, digits or hyphens.')])),
                ('definition', models.TextField(default='')),
                ('conditional_definitions', wagtail.fields.StreamField([('conditional_definition', swatchbook.blocks.ConditionalVariableBlock())], blank=True, null=True, use_json_field=True)),
            ],
            options={
                'verbose_name': 'Stylesheet Variable',
                'verbose_name_plural': 'Stylesheet Variables',
            },
        ),
        migrations.AddConstraint(
            model_name='stylesheetvariable',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_swatchbook_stylesheetvariable.identifier'),
        ),
        migrations.AddConstraint(
            model_name='mediaquery',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_swatchbook_mediaquery.identifier'),
        ),
        migrations.AddConstraint(
            model_name='fontfamily',
            constraint=models.UniqueConstraint(fields=('name',), name='unique_swatchbook_fontfamily.name'),
        ),
        migrations.AddField(
            model_name='fontfaceattachment',
            name='model',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='attachments', to='swatchbook.fontface'),
        ),
        migrations.AddField(
            model_name='fontface',
            name='family',
            field=modelcluster.fields.ParentalKey(on_delete=django.db.models.deletion.CASCADE, related_name='faces', to='swatchbook.fontfamily'),
        ),
        migrations.AddField(
            model_name='fontalias',
            name='family',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='aliases', to='swatchbook.fontfamily'),
        ),
        migrations.AddConstraint(
            model_name='colour',
            constraint=models.UniqueConstraint(fields=('identifier',), name='unique_swatchbook_colour.identifier'),
        ),
        migrations.AddConstraint(
            model_name='fontalias',
            constraint=models.UniqueConstraint(fields=('alias',), name='unique_swatchbook_fontalias.alias'),
        ),
    ]
