~widelands-dev/widelands-website/responsive_website

« back to all changes in this revision

Viewing changes to djangoratings/migrations/0006_add_cookies.py

  • Committer: franku
  • Date: 2016-05-18 19:31:46 UTC
  • mto: This revision was merged to the branch mainline in revision 409.
  • Revision ID: somal@arcor.de-20160518193146-w5dmezymi3wlnhvl
added djangoratings and adjust it to django 1.8; updated update_problems.txt

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# encoding: utf-8
 
2
import datetime
 
3
from south.db import db
 
4
from south.v2 import SchemaMigration
 
5
from django.db import models
 
6
 
 
7
class Migration(SchemaMigration):
 
8
 
 
9
    def forwards(self, orm):
 
10
        
 
11
        # Removing unique constraint on 'Vote', fields ['key', 'ip_address', 'object_id', 'content_type', 'user']
 
12
        db.delete_unique('djangoratings_vote', ['key', 'ip_address', 'object_id', 'content_type_id', 'user_id'])
 
13
 
 
14
        # Adding field 'Vote.cookie'
 
15
        db.add_column('djangoratings_vote', 'cookie', self.gf('django.db.models.fields.CharField')(max_length=32, null=True, blank=True), keep_default=False)
 
16
 
 
17
        # Adding unique constraint on 'Vote', fields ['content_type', 'object_id', 'cookie', 'user', 'key', 'ip_address']
 
18
        db.create_unique('djangoratings_vote', ['content_type_id', 'object_id', 'cookie', 'user_id', 'key', 'ip_address'])
 
19
 
 
20
 
 
21
    def backwards(self, orm):
 
22
        
 
23
        # Removing unique constraint on 'Vote', fields ['content_type', 'object_id', 'cookie', 'user', 'key', 'ip_address']
 
24
        db.delete_unique('djangoratings_vote', ['content_type_id', 'object_id', 'cookie', 'user_id', 'key', 'ip_address'])
 
25
 
 
26
        # Deleting field 'Vote.cookie'
 
27
        db.delete_column('djangoratings_vote', 'cookie')
 
28
 
 
29
        # Adding unique constraint on 'Vote', fields ['key', 'ip_address', 'object_id', 'content_type', 'user']
 
30
        db.create_unique('djangoratings_vote', ['key', 'ip_address', 'object_id', 'content_type_id', 'user_id'])
 
31
 
 
32
 
 
33
    models = {
 
34
        'auth.group': {
 
35
            'Meta': {'object_name': 'Group'},
 
36
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
37
            'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}),
 
38
            'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'})
 
39
        },
 
40
        'auth.permission': {
 
41
            'Meta': {'ordering': "('content_type__app_label', 'content_type__model', 'codename')", 'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'},
 
42
            'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
43
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
 
44
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
45
            'name': ('django.db.models.fields.CharField', [], {'max_length': '50'})
 
46
        },
 
47
        'auth.user': {
 
48
            'Meta': {'object_name': 'User'},
 
49
            'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
50
            'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}),
 
51
            'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
 
52
            'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}),
 
53
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
54
            'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True'}),
 
55
            'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
56
            'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
57
            'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
58
            'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}),
 
59
            'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}),
 
60
            'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}),
 
61
            'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'})
 
62
        },
 
63
        'contenttypes.contenttype': {
 
64
            'Meta': {'ordering': "('name',)", 'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"},
 
65
            'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
66
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
67
            'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
 
68
            'name': ('django.db.models.fields.CharField', [], {'max_length': '100'})
 
69
        },
 
70
        'djangoratings.ignoredobject': {
 
71
            'Meta': {'unique_together': "(('content_type', 'object_id'),)", 'object_name': 'IgnoredObject'},
 
72
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
 
73
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
74
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
 
75
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['auth.User']"})
 
76
        },
 
77
        'djangoratings.score': {
 
78
            'Meta': {'unique_together': "(('content_type', 'object_id', 'key'),)", 'object_name': 'Score'},
 
79
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}),
 
80
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
81
            'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
 
82
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
 
83
            'score': ('django.db.models.fields.IntegerField', [], {}),
 
84
            'votes': ('django.db.models.fields.PositiveIntegerField', [], {})
 
85
        },
 
86
        'djangoratings.similaruser': {
 
87
            'Meta': {'unique_together': "(('from_user', 'to_user'),)", 'object_name': 'SimilarUser'},
 
88
            'agrees': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
 
89
            'disagrees': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0'}),
 
90
            'exclude': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
 
91
            'from_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'similar_users'", 'to': "orm['auth.User']"}),
 
92
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
93
            'to_user': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'similar_users_from'", 'to': "orm['auth.User']"})
 
94
        },
 
95
        'djangoratings.vote': {
 
96
            'Meta': {'unique_together': "(('content_type', 'object_id', 'key', 'user', 'ip_address', 'cookie'),)", 'object_name': 'Vote'},
 
97
            'content_type': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'votes'", 'to': "orm['contenttypes.ContentType']"}),
 
98
            'cookie': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
 
99
            'date_added': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
100
            'date_changed': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}),
 
101
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
 
102
            'ip_address': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
 
103
            'key': ('django.db.models.fields.CharField', [], {'max_length': '32'}),
 
104
            'object_id': ('django.db.models.fields.PositiveIntegerField', [], {}),
 
105
            'score': ('django.db.models.fields.IntegerField', [], {}),
 
106
            'user': ('django.db.models.fields.related.ForeignKey', [], {'blank': 'True', 'related_name': "'votes'", 'null': 'True', 'to': "orm['auth.User']"})
 
107
        }
 
108
    }
 
109
 
 
110
    complete_apps = ['djangoratings']