Permalink
Browse files

add south migration

  • Loading branch information...
1 parent c990cd0 commit 7e2820a9a90c5a5ca549745c1a5869c6fb28836b @tomkralidis tomkralidis committed Sep 12, 2012
@@ -0,0 +1,256 @@
+# 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 model 'Link'
+ db.create_table('layers_link', (
+ ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
+ ('layer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['layers.Layer'])),
+ ('extension', self.gf('django.db.models.fields.CharField')(max_length=255)),
+ ('link_type', self.gf('django.db.models.fields.CharField')(max_length=255)),
+ ('name', self.gf('django.db.models.fields.CharField')(max_length=255)),
+ ('mime', self.gf('django.db.models.fields.CharField')(max_length=255)),
+ ('url', self.gf('django.db.models.fields.TextField')(unique=True, max_length=1000)),
+ ))
+ db.send_create_signal('layers', ['Link'])
+
+ # Changing field 'ContactRole.layer'
+ db.alter_column('layers_contactrole', 'layer_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['layers.Layer'], null=True))
+
+ # Deleting field 'Layer.geographic_bounding_box'
+ db.delete_column('layers_layer', 'geographic_bounding_box')
+
+ # Adding field 'Layer.bbox_x0'
+ db.add_column('layers_layer', 'bbox_x0', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=19, decimal_places=10, blank=True), keep_default=False)
+
+ # Adding field 'Layer.bbox_x1'
+ db.add_column('layers_layer', 'bbox_x1', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=19, decimal_places=10, blank=True), keep_default=False)
+
+ # Adding field 'Layer.bbox_y0'
+ db.add_column('layers_layer', 'bbox_y0', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=19, decimal_places=10, blank=True), keep_default=False)
+
+ # Adding field 'Layer.bbox_y1'
+ db.add_column('layers_layer', 'bbox_y1', self.gf('django.db.models.fields.DecimalField')(null=True, max_digits=19, decimal_places=10, blank=True), keep_default=False)
+
+ # Adding field 'Layer.srid'
+ db.add_column('layers_layer', 'srid', self.gf('django.db.models.fields.CharField')(default='EPSG:4326', max_length=255), keep_default=False)
+
+ # Adding field 'Layer.csw_typename'
+ db.add_column('layers_layer', 'csw_typename', self.gf('django.db.models.fields.CharField')(default='gmd:MD_Metadata', max_length=32), keep_default=False)
+
+ # Adding field 'Layer.csw_schema'
+ db.add_column('layers_layer', 'csw_schema', self.gf('django.db.models.fields.CharField')(default='http://www.isotc211.org/2005/gmd', max_length=64), keep_default=False)
+
+ # Adding field 'Layer.csw_mdsource'
+ db.add_column('layers_layer', 'csw_mdsource', self.gf('django.db.models.fields.CharField')(default='local', max_length=256), keep_default=False)
+
+ # Adding field 'Layer.csw_insert_date'
+ db.add_column('layers_layer', 'csw_insert_date', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, null=True, blank=True), keep_default=False)
+
+ # Adding field 'Layer.csw_type'
+ db.add_column('layers_layer', 'csw_type', self.gf('django.db.models.fields.CharField')(default='dataset', max_length=32), keep_default=False)
+
+ # Adding field 'Layer.csw_anytext'
+ db.add_column('layers_layer', 'csw_anytext', self.gf('django.db.models.fields.TextField')(null=True), keep_default=False)
+
+ # Adding field 'Layer.csw_wkt_geometry'
+ db.add_column('layers_layer', 'csw_wkt_geometry', self.gf('django.db.models.fields.TextField')(default='SRID=4326;POLYGON((-180 180,-180 90,-90 90,-90 180,-180 180))'), keep_default=False)
+
+ # Adding field 'Layer.metadata_xml'
+ db.add_column('layers_layer', 'metadata_xml', self.gf('django.db.models.fields.TextField')(default='<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"/>', null=True, blank=True), keep_default=False)
+
+
+ def backwards(self, orm):
+
+ # Deleting model 'Link'
+ db.delete_table('layers_link')
+
+ # User chose to not deal with backwards NULL issues for 'ContactRole.layer'
+ raise RuntimeError("Cannot reverse this migration. 'ContactRole.layer' and its values cannot be restored.")
+
+ # User chose to not deal with backwards NULL issues for 'Layer.geographic_bounding_box'
+ raise RuntimeError("Cannot reverse this migration. 'Layer.geographic_bounding_box' and its values cannot be restored.")
+
+ # Deleting field 'Layer.bbox_x0'
+ db.delete_column('layers_layer', 'bbox_x0')
+
+ # Deleting field 'Layer.bbox_x1'
+ db.delete_column('layers_layer', 'bbox_x1')
+
+ # Deleting field 'Layer.bbox_y0'
+ db.delete_column('layers_layer', 'bbox_y0')
+
+ # Deleting field 'Layer.bbox_y1'
+ db.delete_column('layers_layer', 'bbox_y1')
+
+ # Deleting field 'Layer.srid'
+ db.delete_column('layers_layer', 'srid')
+
+ # Deleting field 'Layer.csw_typename'
+ db.delete_column('layers_layer', 'csw_typename')
+
+ # Deleting field 'Layer.csw_schema'
+ db.delete_column('layers_layer', 'csw_schema')
+
+ # Deleting field 'Layer.csw_mdsource'
+ db.delete_column('layers_layer', 'csw_mdsource')
+
+ # Deleting field 'Layer.csw_insert_date'
+ db.delete_column('layers_layer', 'csw_insert_date')
+
+ # Deleting field 'Layer.csw_type'
+ db.delete_column('layers_layer', 'csw_type')
+
+ # Deleting field 'Layer.csw_anytext'
+ db.delete_column('layers_layer', 'csw_anytext')
+
+ # Deleting field 'Layer.csw_wkt_geometry'
+ db.delete_column('layers_layer', 'csw_wkt_geometry')
+
+ # Deleting field 'Layer.metadata_xml'
+ db.delete_column('layers_layer', 'metadata_xml')
+
+
+ models = {
+ 'auth.group': {
+ 'Meta': {'object_name': 'Group'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
+ },
+ 'auth.permission': {
+ 'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
+ 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
+ },
+ 'auth.user': {
+ 'Meta': {'object_name': 'User'},
+ 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 9, 12, 14, 33, 44, 309906)'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
+ 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
+ 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
+ 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2012, 9, 12, 14, 33, 44, 309778)'}),
+ 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
+ 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
+ },
+ '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'})
+ },
+ 'layers.contactrole': {
+ 'Meta': {'unique_together': "(('contact', 'layer', 'role'),)", 'object_name': 'ContactRole'},
+ 'contact': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['people.Contact']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['layers.Layer']", 'null': 'True'}),
+ 'role': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['people.Role']"})
+ },
+ 'layers.layer': {
+ 'Meta': {'object_name': 'Layer'},
+ 'abstract': ('django.db.models.fields.TextField', [], {'blank': 'True'}),
+ 'bbox_x0': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '19', 'decimal_places': '10', 'blank': 'True'}),
+ 'bbox_x1': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '19', 'decimal_places': '10', 'blank': 'True'}),
+ 'bbox_y0': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '19', 'decimal_places': '10', 'blank': 'True'}),
+ 'bbox_y1': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '19', 'decimal_places': '10', 'blank': 'True'}),
+ 'constraints_other': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'constraints_use': ('django.db.models.fields.CharField', [], {'default': "'copyright'", 'max_length': '255'}),
+ 'contacts': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['people.Contact']", 'through': "orm['layers.ContactRole']", 'symmetrical': 'False'}),
+ 'csw_anytext': ('django.db.models.fields.TextField', [], {'null': 'True'}),
+ 'csw_insert_date': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'null': 'True', 'blank': 'True'}),
+ 'csw_mdsource': ('django.db.models.fields.CharField', [], {'default': "'local'", 'max_length': '256'}),
+ 'csw_schema': ('django.db.models.fields.CharField', [], {'default': "'http://www.isotc211.org/2005/gmd'", 'max_length': '64'}),
+ 'csw_type': ('django.db.models.fields.CharField', [], {'default': "'dataset'", 'max_length': '32'}),
+ 'csw_typename': ('django.db.models.fields.CharField', [], {'default': "'gmd:MD_Metadata'", 'max_length': '32'}),
+ 'csw_wkt_geometry': ('django.db.models.fields.TextField', [], {'default': "'SRID=4326;POLYGON((-180 180,-180 90,-90 90,-90 180,-180 180))'"}),
+ 'data_quality_statement': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'date': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
+ 'date_type': ('django.db.models.fields.CharField', [], {'default': "'publication'", 'max_length': '255'}),
+ 'distribution_description': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'distribution_url': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'edition': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'keywords_region': ('django.db.models.fields.CharField', [], {'default': "'USA'", 'max_length': '3'}),
+ 'language': ('django.db.models.fields.CharField', [], {'default': "'eng'", 'max_length': '3'}),
+ 'maintenance_frequency': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'metadata_xml': ('django.db.models.fields.TextField', [], {'default': '\'<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd"/>\'', 'null': 'True', 'blank': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']", 'null': 'True', 'blank': 'True'}),
+ 'purpose': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'spatial_representation_type': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'srid': ('django.db.models.fields.CharField', [], {'default': "'EPSG:4326'", 'max_length': '255'}),
+ 'store': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'storeType': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
+ 'supplemental_information': ('django.db.models.fields.TextField', [], {'default': "u'No information provided'"}),
+ 'temporal_extent_end': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'temporal_extent_start': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),
+ 'title': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'topic_category': ('django.db.models.fields.CharField', [], {'default': "'location'", 'max_length': '255'}),
+ 'typename': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '128'}),
+ 'uuid': ('django.db.models.fields.CharField', [], {'max_length': '36'}),
+ 'workspace': ('django.db.models.fields.CharField', [], {'max_length': '128'})
+ },
+ 'layers.link': {
+ 'Meta': {'object_name': 'Link'},
+ 'extension': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'layer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['layers.Layer']"}),
+ 'link_type': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'mime': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
+ 'url': ('django.db.models.fields.TextField', [], {'unique': 'True', 'max_length': '1000'})
+ },
+ 'people.contact': {
+ 'Meta': {'object_name': 'Contact'},
+ 'area': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'city': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'country': ('django.db.models.fields.CharField', [], {'max_length': '3', 'null': 'True', 'blank': 'True'}),
+ 'delivery': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'null': 'True', 'blank': 'True'}),
+ 'fax': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'organization': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'position': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'profile': ('django.db.models.fields.TextField', [], {'null': 'True', 'blank': 'True'}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"}),
+ 'voice': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'}),
+ 'zipcode': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True', 'blank': 'True'})
+ },
+ 'people.role': {
+ 'Meta': {'object_name': 'Role'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
+ 'value': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'})
+ },
+ 'taggit.tag': {
+ 'Meta': {'object_name': 'Tag'},
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
+ 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100', 'db_index': 'True'})
+ },
+ 'taggit.taggeditem': {
+ 'Meta': {'object_name': 'TaggedItem'},
+ 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_tagged_items'", 'to': "orm['contenttypes.ContentType']"}),
+ 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
+ 'object_id': ('django.db.models.fields.IntegerField', [], {'db_index': 'True'}),
+ 'tag': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'taggit_taggeditem_items'", 'to': "orm['taggit.Tag']"})
+ }
+ }
+
+ complete_apps = ['layers']

0 comments on commit 7e2820a

Please sign in to comment.