# Generated by Django 3.0 on 2020-02-11 15:30

from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import hittalaget.teams.models


class Migration(migrations.Migration):

    initial = True

    dependencies = [
        migrations.swappable_dependency(settings.AUTH_USER_MODEL),
        ('users', '0002_auto_20200211_1530'),
    ]

    operations = [
        migrations.CreateModel(
            name='Team',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('name', models.CharField(max_length=255)),
                ('team_id', models.IntegerField(unique=True)),
                ('slug', models.SlugField()),
                ('founded', models.PositiveIntegerField()),
                ('home', models.CharField(max_length=255)),
                ('is_looking', models.BooleanField(default=False)),
                ('is_verified', models.BooleanField(default=False)),
                ('website', models.URLField(blank=True, max_length=255)),
                ('sport', models.CharField(choices=[('fotboll', 'Fotboll')], max_length=255)),
                ('level', models.CharField(max_length=255)),
                ('image', models.ImageField(blank=True, default='images/teams/default.jpg', null=True, upload_to=hittalaget.teams.models.get_upload_path)),
                ('city', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='users.City')),
                ('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='teams', to=settings.AUTH_USER_MODEL)),
            ],
        ),
        migrations.AddIndex(
            model_name='team',
            index=models.Index(fields=['team_id'], name='teams_team_team_id_6e4de5_idx'),
        ),
        migrations.AddConstraint(
            model_name='team',
            constraint=models.UniqueConstraint(fields=('user', 'sport'), name='unique_team'),
        ),
    ]
