# -*- 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):
        # Deleting field 'Hash.locality'
        db.delete_column('geo_hash', 'locality_id')


    def backwards(self, orm):
        # Adding field 'Hash.locality'
        db.add_column('geo_hash', 'locality',
                      self.gf('django.db.models.fields.related.ForeignKey')(to=orm['geo.Locality'], null=True),
                      keep_default=False)


    models = {
        'contenttypes.contenttype': {
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
        },
        'geo.address': {
            'Meta': {'object_name': 'Address'},
            'address': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '27', 'decimal_places': '25', 'db_index': 'True'}),
            'locality': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Locality']"}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '27', 'decimal_places': '24', 'db_index': 'True'})
        },
        'geo.admin1code': {
            'Meta': {'object_name': 'Admin1Code', 'db_table': "'geo_admin1_code'"},
            'code': ('django.db.models.fields.CharField', [], {'max_length': '5', 'db_index': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.GeoCountry']"}),
            'elevation': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '20', 'decimal_places': '17', 'blank': 'True'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '20', 'decimal_places': '17', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'population': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'slugname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        },
        'geo.admin2code': {
            'Meta': {'object_name': 'Admin2Code', 'db_table': "'geo_admin2_code'"},
            'admin1': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin1Code']", 'null': 'True'}),
            'code': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.GeoCountry']"}),
            'elevation': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '20', 'decimal_places': '17', 'blank': 'True'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '20', 'decimal_places': '17', 'blank': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'population': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),
            'slugname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        },
        'geo.admin3code': {
            'Meta': {'object_name': 'Admin3Code', 'db_table': "'geo_admin3_code'"},
            'admin1': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin1Code']", 'null': 'True'}),
            'admin2': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin2Code']", 'null': 'True'}),
            'code': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.GeoCountry']"}),
            'elevation': ('django.db.models.fields.IntegerField', [], {}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '17'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '17'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'population': ('django.db.models.fields.IntegerField', [], {}),
            'slugname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        },
        'geo.admin4code': {
            'Meta': {'object_name': 'Admin4Code', 'db_table': "'geo_admin4_code'"},
            'admin1': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin1Code']", 'null': 'True'}),
            'admin2': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin2Code']", 'null': 'True'}),
            'admin3': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin3Code']", 'null': 'True'}),
            'code': ('django.db.models.fields.CharField', [], {'max_length': '30', 'db_index': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.GeoCountry']"}),
            'elevation': ('django.db.models.fields.IntegerField', [], {}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '17'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'max_digits': '20', 'decimal_places': '17'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'population': ('django.db.models.fields.IntegerField', [], {}),
            'slugname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        },
        'geo.continent': {
            'Meta': {'object_name': 'Continent'},
            'code': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '20'})
        },
        'geo.country': {
            'Meta': {'ordering': "['iso2', 'name']", 'object_name': 'Country'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'iso2': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '2', 'db_index': 'True'}),
            'iso3': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3', 'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'})
        },
        'geo.department': {
            'Meta': {'ordering': "['number']", 'object_name': 'Department'},
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '25', 'db_index': 'True'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '24', 'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'number': ('django.db.models.fields.CharField', [], {'max_length': "'3'", 'db_index': 'True'}),
            'region': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Region']"}),
            'slug_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        },
        'geo.geocountry': {
            'Meta': {'object_name': 'GeoCountry'},
            'area': ('django.db.models.fields.FloatField', [], {}),
            'capital': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'continent': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Continent']"}),
            'currency_code': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
            'currency_name': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}),
            'fips_code': ('django.db.models.fields.CharField', [], {'max_length': '3'}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),
            'iso_alpha2': ('django.db.models.fields.CharField', [], {'max_length': '2'}),
            'iso_alpha3': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '3'}),
            'iso_numeric': ('django.db.models.fields.IntegerField', [], {'unique': 'True'}),
            'languages': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'phone_prefix': ('django.db.models.fields.CharField', [], {'max_length': '16', 'null': 'True'}),
            'population': ('django.db.models.fields.IntegerField', [], {}),
            'postal_code_fmt': ('django.db.models.fields.CharField', [], {'max_length': '64', 'null': 'True'}),
            'postal_code_re': ('django.db.models.fields.CharField', [], {'max_length': '256', 'null': 'True'}),
            'tld': ('django.db.models.fields.CharField', [], {'max_length': '4', 'null': 'True'})
        },
        'geo.hash': {
            'Meta': {'object_name': 'Hash'},
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
            'geonameid': ('django.db.models.fields.IntegerField', [], {}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
            'slugname': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'weight': ('django.db.models.fields.PositiveIntegerField', [], {})
        },
        'geo.locality': {
            'Meta': {'object_name': 'Locality'},
            'admin1': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin1Code']", 'null': 'True'}),
            'admin2': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin2Code']", 'null': 'True'}),
            'admin3': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin3Code']", 'null': 'True'}),
            'admin4': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Admin4Code']", 'null': 'True'}),
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.GeoCountry']", 'null': 'True'}),
            'department': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Department']", 'null': 'True'}),
            'elevation': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
            'geonameid': ('django.db.models.fields.PositiveIntegerField', [], {'unique': 'True', 'null': 'True', 'db_index': 'True'}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'insee_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': "'5'", 'blank': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '25', 'db_index': 'True'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '24', 'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'population': ('django.db.models.fields.IntegerField', [], {'null': 'True'}),
            'postalcode': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': '100', 'null': 'True', 'blank': 'True'}),
            'slug_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'}),
            'zip_code': ('django.db.models.fields.CharField', [], {'db_index': 'True', 'max_length': "'5'", 'null': 'True', 'blank': 'True'})
        },
        'geo.region': {
            'Meta': {'ordering': "['name']", 'object_name': 'Region'},
            'country': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['geo.Country']"}),
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
            'latitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '25', 'db_index': 'True'}),
            'longitude': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '27', 'decimal_places': '24', 'db_index': 'True'}),
            'name': ('django.db.models.fields.CharField', [], {'max_length': '200'}),
            'number': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True', 'blank': 'True'}),
            'slug_name': ('django.db.models.fields.CharField', [], {'max_length': '200', 'db_index': 'True'})
        }
    }

    complete_apps = ['geo']