mirror of
https://github.com/evennia/evennia.git
synced 2026-03-21 07:16:31 +01:00
Rig up south to be happy with two of our models that FK to one another circularly.
This commit is contained in:
parent
bb7e5dd9f5
commit
d2d86871e9
3 changed files with 20 additions and 7 deletions
|
|
@ -6,8 +6,13 @@ from django.db import models
|
|||
|
||||
class Migration(SchemaMigration):
|
||||
|
||||
#depends_on = (
|
||||
# ("players", "0001_initial"),
|
||||
# ("comms", "0001_initial"),
|
||||
#)
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
|
||||
# Adding model 'Msg'
|
||||
db.create_table('comms_msg', (
|
||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
|
|
@ -44,7 +49,7 @@ class Migration(SchemaMigration):
|
|||
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
|
||||
# Deleting model 'Msg'
|
||||
db.delete_table('comms_msg')
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ from django.db import models
|
|||
class Migration(SchemaMigration):
|
||||
|
||||
def forwards(self, orm):
|
||||
|
||||
|
||||
# Adding model 'ObjAttribute'
|
||||
db.create_table('objects_objattribute', (
|
||||
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
|
||||
|
|
@ -49,7 +49,8 @@ class Migration(SchemaMigration):
|
|||
('db_date_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
|
||||
('db_permissions', self.gf('django.db.models.fields.CharField')(max_length=512, blank=True)),
|
||||
('db_lock_storage', self.gf('django.db.models.fields.TextField')(blank=True)),
|
||||
('db_player', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['players.PlayerDB'], null=True, blank=True)),
|
||||
# Moved to player migration
|
||||
#('db_player', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['players.PlayerDB'], null=True, blank=True)),
|
||||
('db_location', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='locations_set', null=True, to=orm['objects.ObjectDB'])),
|
||||
('db_home', self.gf('django.db.models.fields.related.ForeignKey')(blank=True, related_name='homes_set', null=True, to=orm['objects.ObjectDB'])),
|
||||
('db_cmdset_storage', self.gf('django.db.models.fields.TextField')(null=True)),
|
||||
|
|
@ -58,7 +59,7 @@ class Migration(SchemaMigration):
|
|||
|
||||
|
||||
def backwards(self, orm):
|
||||
|
||||
|
||||
# Removing unique constraint on 'Nick', fields ['db_nick', 'db_type', 'db_obj']
|
||||
db.delete_unique('objects_nick', ['db_nick', 'db_type', 'db_obj_id'])
|
||||
|
||||
|
|
|
|||
|
|
@ -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')
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue