-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: increase
FileField
maximum length to 380 characters (#5390)
### 📣 Summary Increased the maximum length of FileField models from the default to 380 characters. ### 📖 Description The maximum length for FileField objects has been increased to 380 characters (100 by default). This change allows longer file paths to be stored, ensuring compatibility with deeply nested directories or longer file names that might have been truncated previously.
- Loading branch information
1 parent
570046d
commit 507c28f
Showing
7 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
24 changes: 24 additions & 0 deletions
24
kobo/apps/markdownx_uploader/migrations/0003_increase_content_max_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Generated by Django 4.2.15 on 2024-12-19 21:31 | ||
|
||
from django.db import migrations | ||
import private_storage.fields | ||
import private_storage.storage.files | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('markdownx_uploader', '0002_markdownxuploaderfilereference'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='markdownxuploaderfile', | ||
name='content', | ||
field=private_storage.fields.PrivateFileField( | ||
max_length=380, | ||
storage=private_storage.storage.files.PrivateFileSystemStorage(), | ||
upload_to='__markdown_media_files/%Y/%m/%d', | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
kobo/apps/openrosa/apps/logger/migrations/0040_increase_file_fields_max_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Generated by Django 4.2.15 on 2024-12-19 21:31 | ||
|
||
from django.conf import settings | ||
from django.core.files.storage import FileSystemStorage | ||
from django.db import migrations | ||
|
||
import kobo.apps.openrosa.apps.logger.models.attachment | ||
import kobo.apps.openrosa.apps.logger.models.xform | ||
import kpi.fields.file | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
migrations.swappable_dependency(settings.AUTH_USER_MODEL), | ||
('logger', '0039_populate_counters'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='attachment', | ||
name='media_file', | ||
field=kpi.fields.file.ExtendedFileField( | ||
db_index=True, | ||
max_length=380, | ||
storage=FileSystemStorage(), | ||
upload_to=kobo.apps.openrosa.apps.logger.models.attachment.upload_to, | ||
), | ||
), | ||
migrations.AlterField( | ||
model_name='xform', | ||
name='xls', | ||
field=kpi.fields.file.ExtendedFileField( | ||
max_length=380, | ||
null=True, | ||
storage=FileSystemStorage(), | ||
upload_to=kobo.apps.openrosa.apps.logger.models.xform.upload_to, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
kobo/apps/openrosa/apps/main/migrations/0018_increase_metadata_data_file_max_length.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Generated by Django 4.2.15 on 2024-12-19 21:31 | ||
|
||
from django.core.files.storage import FileSystemStorage | ||
from django.db import migrations | ||
|
||
import kobo.apps.openrosa.apps.main.models.meta_data | ||
import kpi.fields.file | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('main', '0017_userprofile_submissions_suspended'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='metadata', | ||
name='data_file', | ||
field=kpi.fields.file.ExtendedFileField( | ||
blank=True, | ||
max_length=380, | ||
null=True, | ||
storage=FileSystemStorage(), | ||
upload_to=kobo.apps.openrosa.apps.main.models.meta_data.upload_to, | ||
), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters