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

Workaround for https://github.com/SmileyChris/easy-thumbnails/issues/388 #414

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions easy_thumbnails/migrations/0003_alter_name_max_length_to_1023.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations


class Migration(migrations.Migration):

dependencies = [
('easy_thumbnails', '0002_thumbnaildimensions'),
]

operations = [
migrations.AlterField(
model_name='source',
name='name',
field=models.CharField(max_length=1023, db_index=True),
preserve_default=True,
),
migrations.AlterField(
model_name='thumbnail',
name='name',
field=models.CharField(max_length=1023, db_index=True),
preserve_default=True,
),
]
2 changes: 1 addition & 1 deletion easy_thumbnails/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _get_thumbnail_manager(self):

class File(models.Model):
storage_hash = models.CharField(max_length=40, db_index=True)
name = models.CharField(max_length=255, db_index=True)
name = models.CharField(max_length=1023, db_index=True)
modified = models.DateTimeField(default=timezone.now)

objects = FileManager()
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models


class Migration(SchemaMigration):

def forwards(self, orm):

# Changing field 'Source.name'
db.alter_column(u'easy_thumbnails_source', 'name', self.gf('django.db.models.fields.CharField')(max_length=1023))

# Changing field 'Thumbnail.name'
db.alter_column(u'easy_thumbnails_thumbnail', 'name', self.gf('django.db.models.fields.CharField')(max_length=1023))

def backwards(self, orm):

# Changing field 'Source.name'
db.alter_column(u'easy_thumbnails_source', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

# Changing field 'Thumbnail.name'
db.alter_column(u'easy_thumbnails_thumbnail', 'name', self.gf('django.db.models.fields.CharField')(max_length=255))

models = {
u'easy_thumbnails.source': {
'Meta': {'unique_together': "((u'storage_hash', u'name'),)", 'object_name': 'Source'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '1023', 'db_index': 'True'}),
'storage_hash': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_index': 'True'})
},
u'easy_thumbnails.thumbnail': {
'Meta': {'unique_together': "((u'storage_hash', u'name', u'source'),)", 'object_name': 'Thumbnail'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'modified': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
'name': ('django.db.models.fields.CharField', [], {'max_length': '1023', 'db_index': 'True'}),
'source': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "u'thumbnails'", 'to': u"orm['easy_thumbnails.Source']"}),
'storage_hash': ('django.db.models.fields.CharField', [], {'max_length': '40', 'db_index': 'True'})
},
u'easy_thumbnails.thumbnaildimensions': {
'Meta': {'object_name': 'ThumbnailDimensions'},
'height': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'thumbnail': ('django.db.models.fields.related.OneToOneField', [], {'related_name': "u'dimensions'", 'unique': 'True', 'to': u"orm['easy_thumbnails.Thumbnail']"}),
'width': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'})
}
}

complete_apps = ['easy_thumbnails']