diff --git a/django_etesync/migrations/0010_auto_20200220_1248.py b/django_etesync/migrations/0010_auto_20200220_1248.py new file mode 100644 index 0000000..0c08ed0 --- /dev/null +++ b/django_etesync/migrations/0010_auto_20200220_1248.py @@ -0,0 +1,19 @@ +# Generated by Django 3.0.3 on 2020-02-20 12:48 + +from django.db import migrations, models +import django_etesync.models + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_etesync', '0009_auto_20200220_1220'), + ] + + operations = [ + migrations.AlterField( + model_name='collectionitemchunk', + name='chunkFile', + field=models.FileField(max_length=150, unique=True, upload_to=django_etesync.models.chunk_directory_path), + ), + ] diff --git a/django_etesync/models.py b/django_etesync/models.py index 0cefbee..37c0dc1 100644 --- a/django_etesync/models.py +++ b/django_etesync/models.py @@ -65,7 +65,7 @@ class CollectionItemChunk(models.Model): max_length=44, validators=[UidValidator]) item = models.ForeignKey(CollectionItem, related_name='chunks', on_delete=models.CASCADE) order = models.CharField(max_length=100, blank=False, null=False) - chunkFile = models.FileField(upload_to=chunk_directory_path, max_length=150) + chunkFile = models.FileField(upload_to=chunk_directory_path, max_length=150, unique=True) class Meta: unique_together = ('item', 'order')