# Generated by Django 4.1.1 on 2023-01-17 15:15

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


class Migration(migrations.Migration):

    dependencies = [
        ('contenttypes', '0002_remove_content_type_name'),
        ('django_form_generator', '0003_remove_field_error_message_remove_field_file_size_and_more'),
    ]

    operations = [
        migrations.CreateModel(
            name='FieldOptionThrough',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('weight', models.PositiveIntegerField(verbose_name='Weight')),
            ],
            options={
                'ordering': ('weight',),
            },
        ),
        migrations.RenameModel(
            old_name='Value',
            new_name='Option',
        ),
        migrations.RemoveField(
            model_name='fieldvaluethrough',
            name='field',
        ),
        migrations.RemoveField(
            model_name='fieldvaluethrough',
            name='value',
        ),
        migrations.AlterModelOptions(
            name='option',
            options={'verbose_name': 'Option', 'verbose_name_plural': 'Options'},
        ),
        migrations.RemoveIndex(
            model_name='option',
            name='f_g_value_name',
        ),
        migrations.AddIndex(
            model_name='option',
            index=models.Index(fields=['name'], name='f_g_option_name'),
        ),
        migrations.RemoveField(
            model_name='field',
            name='values',
        ),
        migrations.RemoveField(
            model_name='form',
            name='theme',
        ),
        migrations.AddField(
            model_name='form',
            name='style',
            field=models.CharField(blank=True, help_text='Inline: 2 field in every row.Inorder: 1 field in every row.dynamic: can dynamicly style the field in FormFieldThrough section/table.', max_length=300, null=True, verbose_name='Style'),
        ),
        migrations.AddField(
            model_name='formapimanager',
            name='cache_by',
            field=models.CharField(blank=True, choices=[('session_key', 'Session Key'), ('user_id', 'User ID'), ('user_ip', 'User IP')], max_length=15, null=True, verbose_name='Cache By'),
        ),
        migrations.AlterField(
            model_name='field',
            name='content_type',
            field=models.ForeignKey(blank=True, limit_choices_to=models.Q(models.Q(('app_label', 'django_form_generator'), ('model', 'field')), models.Q(('app_label', 'django_form_generator'), ('model', 'option')), _connector='OR'), null=True, on_delete=django.db.models.deletion.SET_NULL, related_name='fields', to='contenttypes.contenttype', verbose_name='Depends On Object'),
        ),
        migrations.DeleteModel(
            name='FieldValueThrough',
        ),
        migrations.AddField(
            model_name='fieldoptionthrough',
            name='field',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='field_options', to='django_form_generator.field', verbose_name='Field'),
        ),
        migrations.AddField(
            model_name='fieldoptionthrough',
            name='option',
            field=models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='field_options', to='django_form_generator.option', verbose_name='Option'),
        ),
        migrations.AddField(
            model_name='field',
            name='options',
            field=models.ManyToManyField(help_text='Only for multi value fields like Dropdown, Radio, Checkbox, etc...', related_name='fields', through='django_form_generator.FieldOptionThrough', to='django_form_generator.option', verbose_name='Options'),
        ),
        migrations.AddIndex(
            model_name='fieldoptionthrough',
            index=models.Index(fields=['weight'], name='f_g_fieldoptionthrough_weight'),
        ),
    ]
