Statistics
| Branch: | Tag: | Revision:

root / astakos / im / migrations / 0001_initial.py @ 64cd4730

History | View | Annotate | Download (5.2 kB)

1 64cd4730 Antony Chazapis
# encoding: utf-8
2 64cd4730 Antony Chazapis
import datetime
3 64cd4730 Antony Chazapis
from south.db import db
4 64cd4730 Antony Chazapis
from south.v2 import SchemaMigration
5 64cd4730 Antony Chazapis
from django.db import models
6 64cd4730 Antony Chazapis
7 64cd4730 Antony Chazapis
class Migration(SchemaMigration):
8 64cd4730 Antony Chazapis
9 64cd4730 Antony Chazapis
    def forwards(self, orm):
10 64cd4730 Antony Chazapis
        
11 64cd4730 Antony Chazapis
        # Adding model 'User'
12 64cd4730 Antony Chazapis
        db.create_table('im_user', (
13 64cd4730 Antony Chazapis
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
14 64cd4730 Antony Chazapis
            ('uniq', self.gf('django.db.models.fields.CharField')(max_length=255, null=True)),
15 64cd4730 Antony Chazapis
            ('realname', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
16 64cd4730 Antony Chazapis
            ('email', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
17 64cd4730 Antony Chazapis
            ('affiliation', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
18 64cd4730 Antony Chazapis
            ('state', self.gf('django.db.models.fields.CharField')(default='ACTIVE', max_length=16)),
19 64cd4730 Antony Chazapis
            ('level', self.gf('django.db.models.fields.IntegerField')(default=4)),
20 64cd4730 Antony Chazapis
            ('invitations', self.gf('django.db.models.fields.IntegerField')(default=0)),
21 64cd4730 Antony Chazapis
            ('password', self.gf('django.db.models.fields.CharField')(default='', max_length=255)),
22 64cd4730 Antony Chazapis
            ('is_admin', self.gf('django.db.models.fields.BooleanField')(default=False)),
23 64cd4730 Antony Chazapis
            ('auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True, blank=True)),
24 64cd4730 Antony Chazapis
            ('auth_token_created', self.gf('django.db.models.fields.DateTimeField')(null=True)),
25 64cd4730 Antony Chazapis
            ('auth_token_expires', self.gf('django.db.models.fields.DateTimeField')(null=True)),
26 64cd4730 Antony Chazapis
            ('created', self.gf('django.db.models.fields.DateTimeField')()),
27 64cd4730 Antony Chazapis
            ('updated', self.gf('django.db.models.fields.DateTimeField')()),
28 64cd4730 Antony Chazapis
        ))
29 64cd4730 Antony Chazapis
        db.send_create_signal('im', ['User'])
30 64cd4730 Antony Chazapis
31 64cd4730 Antony Chazapis
        # Adding model 'Invitation'
32 64cd4730 Antony Chazapis
        db.create_table('im_invitation', (
33 64cd4730 Antony Chazapis
            ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
34 64cd4730 Antony Chazapis
            ('inviter', self.gf('django.db.models.fields.related.ForeignKey')(related_name='invitations_sent', null=True, to=orm['im.User'])),
35 64cd4730 Antony Chazapis
            ('realname', self.gf('django.db.models.fields.CharField')(max_length=255)),
36 64cd4730 Antony Chazapis
            ('uniq', self.gf('django.db.models.fields.CharField')(max_length=255)),
37 64cd4730 Antony Chazapis
            ('code', self.gf('django.db.models.fields.BigIntegerField')(db_index=True)),
38 64cd4730 Antony Chazapis
            ('is_accepted', self.gf('django.db.models.fields.BooleanField')(default=False)),
39 64cd4730 Antony Chazapis
            ('created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, blank=True)),
40 64cd4730 Antony Chazapis
            ('accepted', self.gf('django.db.models.fields.DateTimeField')(null=True, blank=True)),
41 64cd4730 Antony Chazapis
        ))
42 64cd4730 Antony Chazapis
        db.send_create_signal('im', ['Invitation'])
43 64cd4730 Antony Chazapis
44 64cd4730 Antony Chazapis
45 64cd4730 Antony Chazapis
    def backwards(self, orm):
46 64cd4730 Antony Chazapis
        
47 64cd4730 Antony Chazapis
        # Deleting model 'User'
48 64cd4730 Antony Chazapis
        db.delete_table('im_user')
49 64cd4730 Antony Chazapis
50 64cd4730 Antony Chazapis
        # Deleting model 'Invitation'
51 64cd4730 Antony Chazapis
        db.delete_table('im_invitation')
52 64cd4730 Antony Chazapis
53 64cd4730 Antony Chazapis
54 64cd4730 Antony Chazapis
    models = {
55 64cd4730 Antony Chazapis
        'im.invitation': {
56 64cd4730 Antony Chazapis
            'Meta': {'object_name': 'Invitation'},
57 64cd4730 Antony Chazapis
            'accepted': ('django.db.models.fields.DateTimeField', [], {'null': 'True', 'blank': 'True'}),
58 64cd4730 Antony Chazapis
            'code': ('django.db.models.fields.BigIntegerField', [], {'db_index': 'True'}),
59 64cd4730 Antony Chazapis
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
60 64cd4730 Antony Chazapis
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
61 64cd4730 Antony Chazapis
            'inviter': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'invitations_sent'", 'null': 'True', 'to': "orm['im.User']"}),
62 64cd4730 Antony Chazapis
            'is_accepted': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
63 64cd4730 Antony Chazapis
            'realname': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
64 64cd4730 Antony Chazapis
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255'})
65 64cd4730 Antony Chazapis
        },
66 64cd4730 Antony Chazapis
        'im.user': {
67 64cd4730 Antony Chazapis
            'Meta': {'object_name': 'User'},
68 64cd4730 Antony Chazapis
            'affiliation': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
69 64cd4730 Antony Chazapis
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True', 'blank': 'True'}),
70 64cd4730 Antony Chazapis
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
71 64cd4730 Antony Chazapis
            'auth_token_expires': ('django.db.models.fields.DateTimeField', [], {'null': 'True'}),
72 64cd4730 Antony Chazapis
            'created': ('django.db.models.fields.DateTimeField', [], {}),
73 64cd4730 Antony Chazapis
            'email': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
74 64cd4730 Antony Chazapis
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
75 64cd4730 Antony Chazapis
            'invitations': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
76 64cd4730 Antony Chazapis
            'is_admin': ('django.db.models.fields.BooleanField', [], {'default': 'False'}),
77 64cd4730 Antony Chazapis
            'level': ('django.db.models.fields.IntegerField', [], {'default': '4'}),
78 64cd4730 Antony Chazapis
            'password': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
79 64cd4730 Antony Chazapis
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
80 64cd4730 Antony Chazapis
            'state': ('django.db.models.fields.CharField', [], {'default': "'ACTIVE'", 'max_length': '16'}),
81 64cd4730 Antony Chazapis
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
82 64cd4730 Antony Chazapis
            'updated': ('django.db.models.fields.DateTimeField', [], {})
83 64cd4730 Antony Chazapis
        }
84 64cd4730 Antony Chazapis
    }
85 64cd4730 Antony Chazapis
86 64cd4730 Antony Chazapis
    complete_apps = ['im']