summaryrefslogtreecommitdiffstats
path: root/group_messaging/migrations
diff options
context:
space:
mode:
authorEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-24 21:43:36 -0400
committerEvgeny Fadeev <evgeny.fadeev@gmail.com>2012-09-24 21:43:36 -0400
commit27c52cc8c52157d539bb3c761a53d1b6192c8b64 (patch)
tree79def6b09af2fcd84709e9f34fc7505c514c8fd6 /group_messaging/migrations
parent18770de6588c50d9a2fdcc863cdf977f257c263b (diff)
downloadaskbot-27c52cc8c52157d539bb3c761a53d1b6192c8b64.tar.gz
askbot-27c52cc8c52157d539bb3c761a53d1b6192c8b64.tar.bz2
askbot-27c52cc8c52157d539bb3c761a53d1b6192c8b64.zip
hopefully fixed a corner case bug in the login system
Diffstat (limited to 'group_messaging/migrations')
-rw-r--r--group_messaging/migrations/0002_auto__add_lastvisittime__add_unique_lastvisittime_user_message__add_fi.py (renamed from group_messaging/migrations/0002_auto__add_lastvisittime__add_field_message_senders_info.py)14
1 files changed, 11 insertions, 3 deletions
diff --git a/group_messaging/migrations/0002_auto__add_lastvisittime__add_field_message_senders_info.py b/group_messaging/migrations/0002_auto__add_lastvisittime__add_unique_lastvisittime_user_message__add_fi.py
index b6d82bc8..5e92ef2b 100644
--- a/group_messaging/migrations/0002_auto__add_lastvisittime__add_field_message_senders_info.py
+++ b/group_messaging/migrations/0002_auto__add_lastvisittime__add_unique_lastvisittime_user_message__add_fi.py
@@ -11,17 +11,24 @@ class Migration(SchemaMigration):
# Adding model 'LastVisitTime'
db.create_table('group_messaging_lastvisittime', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
- ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)),
+ ('user', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['auth.User'])),
+ ('message', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['group_messaging.Message'])),
('at', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
))
db.send_create_signal('group_messaging', ['LastVisitTime'])
+ # Adding unique constraint on 'LastVisitTime', fields ['user', 'message']
+ db.create_unique('group_messaging_lastvisittime', ['user_id', 'message_id'])
+
# Adding field 'Message.senders_info'
db.add_column('group_messaging_message', 'senders_info',
self.gf('django.db.models.fields.CharField')(default='', max_length=64),
keep_default=False)
def backwards(self, orm):
+ # Removing unique constraint on 'LastVisitTime', fields ['user', 'message']
+ db.delete_unique('group_messaging_lastvisittime', ['user_id', 'message_id'])
+
# Deleting model 'LastVisitTime'
db.delete_table('group_messaging_lastvisittime')
@@ -95,10 +102,11 @@ class Migration(SchemaMigration):
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
},
'group_messaging.lastvisittime': {
- 'Meta': {'object_name': 'LastVisitTime'},
+ 'Meta': {'unique_together': "(('user', 'message'),)", 'object_name': 'LastVisitTime'},
'at': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
- 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'})
+ 'message': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['group_messaging.Message']"}),
+ 'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
},
'group_messaging.message': {
'Meta': {'object_name': 'Message'},