Permalink
Browse files

Added index to country_code field, since it is used to create a disti…

…nct list of countries. Bug 660876.
  • Loading branch information...
fwenzel committed May 31, 2011
1 parent 6ca2e83 commit 44f9b502461ab713ea90f7d4e18c44686f6b0376
Showing with 49 additions and 0 deletions.
  1. +49 −0 ffdemo/markup/migrations/0020_add_index_country_code.py
@@ -0,0 +1,49 @@
# encoding: 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):
# Adding index on 'Mark', fields ['country_code']
db.create_index('markup_mark', ['country_code'])
def backwards(self, orm):
# Removing index on 'Mark', fields ['country_code']
db.delete_index('markup_mark', ['country_code'])
models = {
'markup.invitation': {
'Meta': {'object_name': 'Invitation'},
'contributor_type': ('django.db.models.fields.CharField', [], {'max_length': '1'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'invite_code': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '50', 'db_index': 'True'}),
'used_at': ('django.db.models.fields.DateTimeField', [], {'db_index': 'True', 'null': 'True', 'blank': 'True'})
},
'markup.mark': {
'Meta': {'object_name': 'Mark'},
'contributor': ('django.db.models.fields.CharField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
'contributor_locale': ('django.db.models.fields.CharField', [], {'max_length': '5', 'null': 'True', 'blank': 'True'}),
'country_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '2', 'blank': 'True'}),
'date_drawn': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'db_index': 'True', 'blank': 'True'}),
'duplicate_check': ('django.db.models.fields.BigIntegerField', [], {'default': '0'}),
'flaggings': ('django.db.models.fields.IntegerField', [], {'default': '0', 'db_index': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
'ip_address': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}),
'is_approved': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
'points_obj_simplified': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
'reference': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'unique': 'True', 'max_length': '50', 'blank': 'True'})
},
'markup.marksequence': {
'Meta': {'object_name': 'MarkSequence'},
'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'})
}
}
complete_apps = ['markup']

0 comments on commit 44f9b50

Please sign in to comment.