# -*- 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 'CampusPermission.code'
        db.alter_column(u'permissions_campuspermission', 'code', self.gf('django.db.models.fields.SlugField')(max_length=64))
        # Adding index on 'CampusPermission', fields ['code']
        db.create_index(u'permissions_campuspermission', ['code'])


    def backwards(self, orm):
        # Removing index on 'CampusPermission', fields ['code']
        db.delete_index(u'permissions_campuspermission', ['code'])


        # Changing field 'CampusPermission.code'
        db.alter_column(u'permissions_campuspermission', 'code', self.gf('django.db.models.fields.CharField')(max_length=64))

    models = {
        'accounts.campususer': {
            'Meta': {'object_name': 'CampusUser'},
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'email': ('django.db.models.fields.EmailField', [], {'unique': 'True', 'max_length': '75', 'db_index': 'True'}),
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            'middle_name': ('django.db.models.fields.CharField', [], {'max_length': '64'}),
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'})
        },
        'permissions.campusapplication': {
            'Meta': {'object_name': 'CampusApplication'},
            'access_token': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})
        },
        'permissions.campusgroup': {
            'Meta': {'object_name': 'CampusGroup'},
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'groups'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['permissions.CampusPermission']"}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
            'users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'groups'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['accounts.CampusUser']"})
        },
        'permissions.campuspermission': {
            'Meta': {'object_name': 'CampusPermission'},
            'application': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['permissions.CampusApplication']"}),
            'code': ('django.db.models.fields.SlugField', [], {'max_length': '64'}),
            'description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
            'granted_for_users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'granted_permissions'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['accounts.CampusUser']"}),
            u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'revoked_for_users': ('django.db.models.fields.related.ManyToManyField', [], {'blank': 'True', 'related_name': "'revoked_permissions'", 'null': 'True', 'symmetrical': 'False', 'to': "orm['accounts.CampusUser']"}),
            'title': ('django.db.models.fields.CharField', [], {'max_length': '128'})
        }
    }

    complete_apps = ['permissions']