# -*- coding: utf-8 -*-
import 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 'Order.task'
        db.alter_column('orders_order', 'task_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, on_delete=models.SET_NULL, to=orm['orders.Task']))

    def backwards(self, orm):

        # Changing field 'Order.task'
        db.alter_column('orders_order', 'task_id', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['orders.Task']))

    models = {
        'orders.order': {
            'Meta': {'object_name': 'Order'},
            'archive_data': ('picklefield.fields.PickledObjectField', [], {'null': 'True'}),
            'archive_urls': ('picklefield.fields.PickledObjectField', [], {'null': 'True'}),
            'channel_count_err': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'download_err': ('django.db.models.fields.IntegerField', [], {'default': 'False'}),
            'downloaded': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'length_err': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'mismatch_data_err': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'no_link_err': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'orderid': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '20', 'db_index': 'True'}),
            'orderstatus': ('django.db.models.fields.CharField', [], {'max_length': '50', 'null': 'True'}),
            'task': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'orders'", 'null': 'True', 'on_delete': 'models.SET_NULL', 'to': "orm['orders.Task']"}),
            'tend': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'to_download': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
            'tstart': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'uik': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'orders'", 'to': "orm['orders.UIK']"}),
            'unavailable': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'waiting': ('django.db.models.fields.BooleanField', [], {'default': 'True'})
        },
        'orders.region': {
            'Meta': {'ordering': "['name']", 'object_name': 'Region'},
            'channel_count_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
            'downloadable': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'downloaded': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'length_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'mismatch_data_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'name': ('django.db.models.fields.TextField', [], {}),
            'no_link_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'ordered': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'to_download': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'waiting': ('django.db.models.fields.IntegerField', [], {'default': '0'})
        },
        'orders.task': {
            'Meta': {'object_name': 'Task'},
            'error': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'finish_time': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'tstart': ('django.db.models.fields.DateTimeField', [], {}),
            'uik': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['orders.UIK']"})
        },
        'orders.uik': {
            'Meta': {'object_name': 'UIK'},
            'channel_count_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'code': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '10'}),
            'downloadable': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'downloaded': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'length_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'mismatch_data_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'name': ('django.db.models.fields.TextField', [], {}),
            'no_link_err': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'num': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
            'ordered': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'region': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['orders.Region']"}),
            'tmax': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'tmin': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
            'to_download': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
            'waiting': ('django.db.models.fields.IntegerField', [], {'default': '0'})
        }
    }

    complete_apps = ['orders']