"""
Homepage carousel slides.

A new table and nothing else. No existing model is touched, no column changes
on a live table, so this applies to every install without a moment where the
code and the database disagree.

A site with no rows renders exactly as before, because the templates fall back
to their own hero when the slide list is empty.
"""
from django.db import migrations, models
import django.db.models.deletion

import apps.accounts.fields


class Migration(migrations.Migration):

    dependencies = [
        ('pages', '0045_google_tag_manager_id'),
        ('tenants', '0024_module_choices_brands'),
    ]

    operations = [
        migrations.CreateModel(
            name='HomeSlide',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('image', apps.accounts.fields.WebPImageField(
                    blank=True, null=True, upload_to='slides/',
                    help_text='Background image. Landscape, at least 1600px wide.')),
                ('label', models.CharField(blank=True, default='', max_length=80,
                    help_text='Small line above the headline, e.g. Business Group.')),
                ('headline', models.CharField(blank=True, default='', max_length=160)),
                ('headline_em', models.CharField(blank=True, default='', max_length=160,
                    help_text='Second part of the headline, shown emphasised on its own line.')),
                ('body', models.TextField(blank=True, default='')),
                ('btn1_text', models.CharField(blank=True, default='', max_length=60)),
                ('btn1_url', models.CharField(blank=True, default='', max_length=300,
                    help_text='A path such as #portfolio or /services/, or a full address.')),
                ('btn2_text', models.CharField(blank=True, default='', max_length=60)),
                ('btn2_url', models.CharField(blank=True, default='', max_length=300)),
                ('order', models.PositiveIntegerField(default=1)),
                ('is_active', models.BooleanField(default=True)),
                ('created_at', models.DateTimeField(auto_now_add=True)),
                ('tenant', models.ForeignKey(
                    blank=True, null=True, on_delete=django.db.models.deletion.CASCADE,
                    related_name='home_slides', to='tenants.tenant')),
            ],
            options={
                'verbose_name': 'Homepage Slide',
                'verbose_name_plural': 'Homepage Slides',
                'ordering': ['order', 'id'],
            },
        ),
    ]
