# Generated by Django 4.2.16 on 2024-10-01 15:24

# Django
import django.db.models.deletion
from django.db import migrations, models


class Migration(migrations.Migration):
    dependencies = [
        ("kapt_ads", "0002_alter_ad_text"),
    ]

    operations = [
        migrations.CreateModel(
            name="Location",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                ("name", models.CharField(max_length=150, verbose_name="Name")),
                (
                    "format",
                    models.CharField(
                        choices=[
                            ("square", "Square"),
                            ("horizontal_banner", "Horizontal banner"),
                            ("vertical_banner", "Vertical banner"),
                        ],
                        max_length=150,
                        verbose_name="Format",
                    ),
                ),
            ],
            options={
                "verbose_name": "Location",
                "verbose_name_plural": "Locations",
            },
        ),
        migrations.RenameField(
            model_name="ad",
            old_name="date_end",
            new_name="publication_date_end",
        ),
        migrations.RenameField(
            model_name="ad",
            old_name="date_start",
            new_name="publication_date_start",
        ),
        migrations.RemoveField(
            model_name="ad",
            name="label",
        ),
        migrations.RemoveField(
            model_name="ad",
            name="page_location",
        ),
        migrations.AddField(
            model_name="ad",
            name="name",
            field=models.CharField(
                default="no name",
                help_text="For admin use only. Will not appear on the ad.",
                max_length=150,
                verbose_name="Name",
            ),
            preserve_default=False,
        ),
        migrations.AddField(
            model_name="ad",
            name="location",
            field=models.ForeignKey(
                null=True,
                on_delete=django.db.models.deletion.SET_NULL,
                to="kapt_ads.location",
                verbose_name="Location",
            ),
        ),
    ]
