From be5d5ce5cfdce5aa9948ce37cc56a33d53393039 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Mon, 5 Jan 2015 04:03:39 -0400 Subject: [PATCH] Increase ocr node field size from 32 to 256 characters --- mayan/apps/ocr/models.py | 2 +- ...ode_name__chg_field_queuedocument_datet.py | 60 +++++++++++++++++++ 2 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 mayan/apps/ocr/south_migrations/0003_auto__chg_field_queuedocument_node_name__chg_field_queuedocument_datet.py diff --git a/mayan/apps/ocr/models.py b/mayan/apps/ocr/models.py index 24dd3fb961..8533dcea2a 100644 --- a/mayan/apps/ocr/models.py +++ b/mayan/apps/ocr/models.py @@ -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',) diff --git a/mayan/apps/ocr/south_migrations/0003_auto__chg_field_queuedocument_node_name__chg_field_queuedocument_datet.py b/mayan/apps/ocr/south_migrations/0003_auto__chg_field_queuedocument_node_name__chg_field_queuedocument_datet.py new file mode 100644 index 0000000000..a2b211c708 --- /dev/null +++ b/mayan/apps/ocr/south_migrations/0003_auto__chg_field_queuedocument_node_name__chg_field_queuedocument_datet.py @@ -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'] \ No newline at end of file