diff --git a/readthedocs/projects/migrations/0040_increase_path_max_length.py b/readthedocs/projects/migrations/0040_increase_path_max_length.py new file mode 100644 index 000000000..37778f670 --- /dev/null +++ b/readthedocs/projects/migrations/0040_increase_path_max_length.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.11.20 on 2019-02-23 15:05 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('projects', '0039_update-doctype-helptext'), + ] + + operations = [ + migrations.AlterField( + model_name='importedfile', + name='path', + field=models.CharField(max_length=4096, verbose_name='Path'), + ), + ] diff --git a/readthedocs/projects/models.py b/readthedocs/projects/models.py index 9b8e32d2e..b5fca92d2 100644 --- a/readthedocs/projects/models.py +++ b/readthedocs/projects/models.py @@ -1089,7 +1089,11 @@ class ImportedFile(models.Model): ) name = models.CharField(_('Name'), max_length=255) slug = models.SlugField(_('Slug')) - path = models.CharField(_('Path'), max_length=255) + + # max_length is set to 4096 because linux has a maximum path length + # of 4096 characters for most filesystems (including EXT4). + # https://github.com/rtfd/readthedocs.org/issues/5061 + path = models.CharField(_('Path'), max_length=4096) md5 = models.CharField(_('MD5 checksum'), max_length=255) commit = models.CharField(_('Commit'), max_length=255) modified_date = models.DateTimeField(_('Modified date'), auto_now=True)