From 1c013c31745b335962a07057f962e47212faf80f Mon Sep 17 00:00:00 2001 From: Radek Czajka Date: Mon, 21 Oct 2024 13:32:14 +0200 Subject: [PATCH] Change field length. --- src/cover/migrations/0007_alter_image_file.py | 24 +++++++++++++++++++ src/cover/models.py | 1 + 2 files changed, 25 insertions(+) create mode 100644 src/cover/migrations/0007_alter_image_file.py diff --git a/src/cover/migrations/0007_alter_image_file.py b/src/cover/migrations/0007_alter_image_file.py new file mode 100644 index 00000000..812b9380 --- /dev/null +++ b/src/cover/migrations/0007_alter_image_file.py @@ -0,0 +1,24 @@ +# Generated by Django 4.1.9 on 2024-10-21 13:31 + +import cover.models +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("cover", "0006_image_example"), + ] + + operations = [ + migrations.AlterField( + model_name="image", + name="file", + field=models.ImageField( + max_length=1024, + storage=cover.models.OverwriteStorage(), + upload_to="cover/image", + verbose_name="file", + ), + ), + ] diff --git a/src/cover/models.py b/src/cover/models.py index d7662227..2c452a27 100644 --- a/src/cover/models.py +++ b/src/cover/models.py @@ -33,6 +33,7 @@ class Image(models.Model): download_url = models.URLField(max_length=4096, unique=True, verbose_name=_('image download URL'), null=True, blank=True) file = models.ImageField( upload_to='cover/image', + max_length=1024, storage=OverwriteStorage(), verbose_name=_('file') ) -- 2.20.1