Rig up south to be happy with two of our models that FK to one another circularly.

This commit is contained in:
Greg Taylor 2011-03-24 21:07:09 +00:00
parent bb7e5dd9f5
commit d2d86871e9
3 changed files with 20 additions and 7 deletions

View file

@ -6,8 +6,12 @@ from django.db import models
class Migration(SchemaMigration):
depends_on = (
("objects", "0001_initial"),
)
def forwards(self, orm):
# Adding model 'PlayerAttribute'
db.create_table('players_playerattribute', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
@ -33,9 +37,12 @@ class Migration(SchemaMigration):
))
db.send_create_signal('players', ['PlayerDB'])
# Hack to get around circular table creation.
db.add_column('objects_objectdb', 'db_player', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['players.PlayerDB'], null=True, blank=True))
def backwards(self, orm):
# Deleting model 'PlayerAttribute'
db.delete_table('players_playerattribute')