# Generated by Django 2.1.3 on 2022-01-13 15:09

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


class Migration(migrations.Migration):

    dependencies = [
        ('commons', '0031_auto_20211227_1344'),
    ]

    state_operations = [
        migrations.CreateModel(
            name='UserProfileLanguage',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
				('userprofile', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='userprofilelanguage_profile', to='commons.UserProfile', verbose_name='user profile')),
                ('language', models.ForeignKey(on_delete=django.db.models.deletion.PROTECT, related_name='userprofilelanguage_language', to='commons.Language', verbose_name='language')),
            ],
            options={
                'verbose_name': 'user language',
                'verbose_name_plural': 'user languages',
                'db_table': 'commons_userprofile_languages',
                'ordering': ('order', 'language__name'),
            },
        ),
        migrations.AlterField(
            model_name='userprofile',
            name='languages',
            field=models.ManyToManyField(through='commons.UserProfileLanguage', to='commons.Language', verbose_name='languages known by user'),
        ),
	]

    operations = [
        migrations.SeparateDatabaseAndState(state_operations=state_operations),
        migrations.AddField(
            model_name='userprofilelanguage',
            name='order',
            field=models.IntegerField(default=0),
        ),
        migrations.AlterUniqueTogether(
            name='userprofilelanguage',
            unique_together={('userprofile', 'language')},
        ),
        migrations.AlterField(
            model_name='document',
            name='language',
            field=models.CharField(choices=[('en', 'English'), ('it', 'Italiano'), ('fr', 'French'), ('pt', 'Português'), ('hr', 'Hrvatski'), ('ru', 'Русский'), ('ar', 'Arabic')], default='en', max_length=8, verbose_name='Language'),
        ),
    ]
