Increase ocr node field size from 32 to 256 characters

This commit is contained in:
Roberto Rosario
2015-01-05 04:03:39 -04:00
parent 9474c5306f
commit be5d5ce5cf
2 changed files with 61 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ class QueueDocument(models.Model):
document = models.ForeignKey(Document, verbose_name=_(u'Document'))
datetime_submitted = models.DateTimeField(verbose_name=_(u'Date time submitted'), auto_now=True, db_index=True)
result = models.TextField(blank=True, null=True, verbose_name=_(u'Result'))
node_name = models.CharField(max_length=32, verbose_name=_(u'Node name'), blank=True, null=True)
node_name = models.CharField(max_length=256, verbose_name=_(u'Node name'), blank=True, null=True)
class Meta:
ordering = ('datetime_submitted',)

View File

@@ -0,0 +1,60 @@
# -*- 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 'QueueDocument.node_name'
db.alter_column(u'ocr_queuedocument', 'node_name', self.gf('django.db.models.fields.CharField')(max_length=256, null=True))
# Changing field 'QueueDocument.datetime_submitted'
db.alter_column(u'ocr_queuedocument', 'datetime_submitted', self.gf('django.db.models.fields.DateTimeField')(auto_now=True))
def backwards(self, orm):
# Changing field 'QueueDocument.node_name'
db.alter_column(u'ocr_queuedocument', 'node_name', self.gf('django.db.models.fields.CharField')(max_length=32, null=True))
# Changing field 'QueueDocument.datetime_submitted'
db.alter_column(u'ocr_queuedocument', 'datetime_submitted', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True))
models = {
u'documents.document': {
'Meta': {'ordering': "['-date_added']", 'object_name': 'Document'},
'date_added': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
'document_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'documents'", 'to': u"orm['documents.DocumentType']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'default': "u'Uninitialized document'", 'max_length': '255', 'db_index': 'True'}),
'language': ('django.db.models.fields.CharField', [], {'default': "u'eng'", 'max_length': '8'}),
'uuid': ('django.db.models.fields.CharField', [], {'default': "u'4371aa11-0222-4718-bd94-c198fd7998e0'", 'max_length': '48'})
},
u'documents.documenttype': {
'Meta': {'ordering': "['name']", 'object_name': 'DocumentType'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}),
'ocr': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
},
u'ocr.documentqueue': {
'Meta': {'object_name': 'DocumentQueue'},
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'label': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '64'})
},
u'ocr.queuedocument': {
'Meta': {'ordering': "('datetime_submitted',)", 'object_name': 'QueueDocument'},
'datetime_submitted': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'db_index': 'True', 'blank': 'True'}),
'document': ('django.db.models.fields.related.ForeignKey', [], {'to': u"orm['documents.Document']"}),
'document_queue': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'documents'", 'to': u"orm['ocr.DocumentQueue']"}),
u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'node_name': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True', 'blank': 'True'}),
'result': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'})
}
}
complete_apps = ['ocr']