# Generated by Django 2.0.9 on 2018-10-23 18:37

from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import funkwhale_api.music.models


class Migration(migrations.Migration):

    dependencies = [
        ('music', '0032_track_file_to_upload'),
    ]

    operations = [
        migrations.CreateModel(
            name='UploadVersion',
            fields=[
                ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
                ('mimetype', models.CharField(choices=[('audio/ogg', 'ogg'), ('audio/mpeg', 'mp3'), ('audio/x-flac', 'flac')], max_length=50)),
                ('creation_date', models.DateTimeField(default=django.utils.timezone.now)),
                ('accessed_date', models.DateTimeField(blank=True, null=True)),
                ('audio_file', models.FileField(max_length=255, upload_to=funkwhale_api.music.models.get_file_path)),
                ('bitrate', models.PositiveIntegerField()),
                ('size', models.IntegerField()),
                ('upload', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='versions', to='music.Upload')),
            ],
        ),
        migrations.AlterField(
            model_name='album',
            name='from_activity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='federation.Activity'),
        ),
        migrations.AlterField(
            model_name='artist',
            name='from_activity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='federation.Activity'),
        ),
        migrations.AlterField(
            model_name='track',
            name='from_activity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='federation.Activity'),
        ),
        migrations.AlterField(
            model_name='work',
            name='from_activity',
            field=models.ForeignKey(blank=True, null=True, on_delete=django.db.models.deletion.SET_NULL, to='federation.Activity'),
        ),
        migrations.AlterUniqueTogether(
            name='uploadversion',
            unique_together={('upload', 'mimetype', 'bitrate')},
        ),
    ]
