From f455bdbd2ec74a80e8033d67000753b3372e0f30 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Tue, 10 Feb 2015 05:08:24 -0400 Subject: [PATCH] Don't point field to a foreign key that doesn't exists yet, make migration dependant on actstream to avoid actstream error when deleting the obsolete content types, add frozen taggit model specifications to avoid taggit content type to be asked to be deleted during migration 0002. Issue #154 --- ...02_auto__add_tag__chg_field_tagproperties_tag.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/mayan/apps/tags/south_migrations/0002_auto__add_tag__chg_field_tagproperties_tag.py b/mayan/apps/tags/south_migrations/0002_auto__add_tag__chg_field_tagproperties_tag.py index 1eed0fcf11..f44b5bea00 100644 --- a/mayan/apps/tags/south_migrations/0002_auto__add_tag__chg_field_tagproperties_tag.py +++ b/mayan/apps/tags/south_migrations/0002_auto__add_tag__chg_field_tagproperties_tag.py @@ -7,6 +7,7 @@ from django.db import models class Migration(SchemaMigration): depends_on = ( ('documents', '0001_initial'), + ('actstream', '0007_auto__add_field_follow_started'), ) def forwards(self, orm): @@ -27,9 +28,6 @@ class Migration(SchemaMigration): )) db.create_unique(m2m_table_name, ['tag_id', 'document_id']) - # Changing field 'TagProperties.tag' - db.alter_column(u'tags_tagproperties', 'tag_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['tags.Tag'])) - def backwards(self, orm): # Deleting model 'Tag' db.delete_table(u'tags_tag') @@ -37,9 +35,6 @@ class Migration(SchemaMigration): # Removing M2M table for field document on 'Tag' db.delete_table(db.shorten_name(u'tags_tag_document')) - # Changing field 'TagProperties.tag' - db.alter_column(u'tags_tagproperties', 'tag_id', self.gf('django.db.models.fields.IntegerField')()) - models = { u'documents.document': { 'Meta': {'ordering': "['-date_added']", 'object_name': 'Document'}, @@ -54,6 +49,12 @@ class Migration(SchemaMigration): u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '32'}) }, + u'taggit.tag': { + 'Meta': {'object_name': 'Tag'}, + u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '100'}), + 'slug': ('django.db.models.fields.SlugField', [], {'unique': 'True', 'max_length': '100'}) + }, u'tags.tag': { 'Meta': {'object_name': 'Tag'}, 'color': ('django.db.models.fields.CharField', [], {'max_length': '3'}),