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

This commit is contained in:
Roberto Rosario
2015-02-10 05:08:24 -04:00
parent 8bb4aaee3e
commit f455bdbd2e

View File

@@ -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'}),