Skip to content

Commit 31d3dd5

Browse files
committed
truncate all streams to 200
1 parent aa8c09c commit 31d3dd5

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# -*- coding: utf-8 -*-
2+
import datetime
3+
from south.db import db
4+
from south.v2 import DataMigration
5+
from django.db import models
6+
7+
class Migration(DataMigration):
8+
9+
def forwards(self, orm):
10+
from subscription.client import get_cache_client
11+
conn = get_cache_client()
12+
for item in conn.keys("actstream::*"):
13+
conn.ltrim(item, 0, 200)
14+
15+
"Write your forwards methods here."
16+
# Note: Remember to use orm['appname.ModelName'] rather than "from appname.models..."
17+
18+
def backwards(self, orm):
19+
"Write your backwards methods here."
20+
21+
models = {
22+
'auth.group': {
23+
'Meta': {'object_name': 'Group'},
24+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
25+
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
26+
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
27+
},
28+
'auth.permission': {
29+
'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
30+
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
31+
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
32+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
33+
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
34+
},
35+
'auth.user': {
36+
'Meta': {'object_name': 'User'},
37+
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
38+
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
39+
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
40+
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
41+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
42+
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
43+
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
44+
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
45+
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
46+
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
47+
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
48+
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
49+
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
50+
},
51+
'contenttypes.contenttype': {
52+
'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
53+
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
54+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
55+
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
56+
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
57+
},
58+
'subscription.subscription': {
59+
'Meta': {'object_name': 'Subscription', 'db_table': "'subscription'"},
60+
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
61+
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
62+
'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
63+
'timestamp': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
64+
'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
65+
}
66+
}
67+
68+
complete_apps = ['subscription']
69+
symmetrical = True

0 commit comments

Comments
 (0)