Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase File name field length #624

Open
petrklus opened this issue Sep 6, 2023 · 1 comment
Open

Increase File name field length #624

petrklus opened this issue Sep 6, 2023 · 1 comment

Comments

@petrklus
Copy link

petrklus commented Sep 6, 2023

For our use-case, we have found that the 255 character limit is not enough to contain large file names + thumbnail prefix folder structure.

I therefore suggest increasing the limit here:

https://github.com/SmileyChris/easy-thumbnails/blob/master/easy_thumbnails/models.py#L55

We have temporarily mitigated the issue with a migration patching the table directly, though it would be great to have a permanent solution.

I think that 4096 should be enough to contain even the longest prefixes alongside the 255/7 file name length max.

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ...
    ]

    operations = [
        migrations.RunSQL(
            "ALTER TABLE easy_thumbnails_thumbnail ALTER COLUMN name TYPE varchar(4096);"),
        migrations.RunSQL(
            "ALTER TABLE easy_thumbnails_source ALTER COLUMN name TYPE varchar(4096);")
    ]
@petrklus
Copy link
Author

petrklus commented Nov 7, 2023

@SmileyChris / @jrief any thoughts on this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant