# Generated by Django 4.0.6 on 2023-01-04 06:54

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


class Migration(migrations.Migration):

    dependencies = [
        ('django_form_generator', '0002_field_read_only_field_write_only'),
    ]

    operations = [
        migrations.RemoveField(
            model_name='field',
            name='error_message',
        ),
        migrations.RemoveField(
            model_name='field',
            name='file_size',
        ),
        migrations.RemoveField(
            model_name='field',
            name='file_types',
        ),
        migrations.RemoveField(
            model_name='field',
            name='regex_pattern',
        ),
        migrations.CreateModel(
            name='FieldValidator',
            fields=[
                ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('created_at', models.DateTimeField(auto_now_add=True, verbose_name='Created at')),
                ('updated_at', models.DateTimeField(auto_now=True, verbose_name='Updated at')),
                ('validator', models.CharField(choices=[('max-length', 'Max length'), ('min-length', 'Min length'), ('max-value', 'Max value'), ('min-value', 'Min value'), ('regex', 'Regex'), ('file-extention', 'File extention'), ('file-size', 'File size')], max_length=100, verbose_name='Validator')),
                ('value', models.CharField(max_length=255, verbose_name='Value')),
                ('error_message', models.CharField(blank=True, max_length=500, null=True, verbose_name='Error Message')),
                ('is_active', models.BooleanField(default=True, verbose_name='Is Active')),
                ('field', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='validators', to='django_form_generator.field', verbose_name='Field')),
            ],
            options={
                'unique_together': {('field', 'validator')},
            },
        ),
    ]
