# Generated by Django 4.2.11 on 2024-12-02 15:35

from django.db import migrations, models
import django.db.models.deletion
import ocyan.plugin.oscar_odin.validators


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        ("contenttypes", "0002_remove_content_type_name"),
    ]

    operations = [
        migrations.CreateModel(
            name="MappingModel",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "date_created",
                    models.DateTimeField(
                        auto_now_add=True, verbose_name="Date Created"
                    ),
                ),
                (
                    "date_updated",
                    models.DateTimeField(
                        auto_now=True, db_index=True, verbose_name="Date Updated"
                    ),
                ),
                (
                    "contenttype",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        to="contenttypes.contenttype",
                        unique=True,
                    ),
                ),
            ],
        ),
        migrations.CreateModel(
            name="FieldMappingModel",
            fields=[
                (
                    "id",
                    models.AutoField(
                        auto_created=True,
                        primary_key=True,
                        serialize=False,
                        verbose_name="ID",
                    ),
                ),
                (
                    "from_fields",
                    models.JSONField(
                        validators=[ocyan.plugin.oscar_odin.validators.validate_list]
                    ),
                ),
                (
                    "to_fields",
                    models.JSONField(
                        validators=[ocyan.plugin.oscar_odin.validators.validate_list]
                    ),
                ),
                (
                    "action_importstring",
                    models.CharField(
                        blank=True,
                        max_length=255,
                        null=True,
                        validators=[
                            ocyan.plugin.oscar_odin.validators.validate_importstring
                        ],
                        verbose_name="Action",
                    ),
                ),
                ("to_list", models.BooleanField(default=False)),
                ("bind", models.BooleanField(default=False)),
                ("skip_if_none", models.BooleanField(default=True)),
                (
                    "mapping",
                    models.ForeignKey(
                        on_delete=django.db.models.deletion.CASCADE,
                        related_name="mappings",
                        to="oscar_odin_plugin.mappingmodel",
                    ),
                ),
            ],
        ),
    ]
