Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / db / migrations / 0002_aai_fields.py @ 2a8a60d5

History | View | Annotate | Download (10 kB)

1 cfe9f88c Georgios Gousios
# encoding: utf-8
2 cfe9f88c Georgios Gousios
import datetime
3 cfe9f88c Georgios Gousios
from south.db import db
4 cfe9f88c Georgios Gousios
from south.v2 import SchemaMigration
5 cfe9f88c Georgios Gousios
from django.db import models
6 cfe9f88c Georgios Gousios
7 cfe9f88c Georgios Gousios
class Migration(SchemaMigration):
8 cfe9f88c Georgios Gousios
9 cfe9f88c Georgios Gousios
    def forwards(self, orm):
10 cfe9f88c Georgios Gousios
        
11 cfe9f88c Georgios Gousios
        # Adding field 'SynnefoUser.realname'
12 cfe9f88c Georgios Gousios
        db.add_column('db_synnefouser', 'realname', self.gf('django.db.models.fields.CharField')(default='', max_length=255), keep_default=False)
13 cfe9f88c Georgios Gousios
14 cfe9f88c Georgios Gousios
        # Adding field 'SynnefoUser.uniq'
15 cfe9f88c Georgios Gousios
        db.add_column('db_synnefouser', 'uniq', self.gf('django.db.models.fields.CharField')(max_length=255, null=True), keep_default=False)
16 cfe9f88c Georgios Gousios
17 cfe9f88c Georgios Gousios
        # Adding field 'SynnefoUser.auth_token'
18 cfe9f88c Georgios Gousios
        db.add_column('db_synnefouser', 'auth_token', self.gf('django.db.models.fields.CharField')(max_length=32, null=True), keep_default=False)
19 cfe9f88c Georgios Gousios
20 cfe9f88c Georgios Gousios
        # Adding field 'SynnefoUser.auth_token_created'
21 cfe9f88c Georgios Gousios
        db.add_column('db_synnefouser', 'auth_token_created', self.gf('django.db.models.fields.DateTimeField')(auto_now_add=True, default=datetime.date(2011, 4, 19), blank=True), keep_default=False)
22 cfe9f88c Georgios Gousios
23 cfe9f88c Georgios Gousios
        # Adding field 'SynnefoUser.type'
24 cfe9f88c Georgios Gousios
        db.add_column('db_synnefouser', 'type', self.gf('django.db.models.fields.CharField')(default=None, max_length=30), keep_default=False)
25 cfe9f88c Georgios Gousios
26 cfe9f88c Georgios Gousios
27 cfe9f88c Georgios Gousios
    def backwards(self, orm):
28 cfe9f88c Georgios Gousios
        
29 cfe9f88c Georgios Gousios
        # Deleting field 'SynnefoUser.realname'
30 cfe9f88c Georgios Gousios
        db.delete_column('db_synnefouser', 'realname')
31 cfe9f88c Georgios Gousios
32 cfe9f88c Georgios Gousios
        # Deleting field 'SynnefoUser.uniq'
33 cfe9f88c Georgios Gousios
        db.delete_column('db_synnefouser', 'uniq')
34 cfe9f88c Georgios Gousios
35 cfe9f88c Georgios Gousios
        # Deleting field 'SynnefoUser.auth_token'
36 cfe9f88c Georgios Gousios
        db.delete_column('db_synnefouser', 'auth_token')
37 cfe9f88c Georgios Gousios
38 cfe9f88c Georgios Gousios
        # Deleting field 'SynnefoUser.auth_token_created'
39 cfe9f88c Georgios Gousios
        db.delete_column('db_synnefouser', 'auth_token_created')
40 cfe9f88c Georgios Gousios
41 cfe9f88c Georgios Gousios
        # Deleting field 'SynnefoUser.type'
42 cfe9f88c Georgios Gousios
        db.delete_column('db_synnefouser', 'type')
43 cfe9f88c Georgios Gousios
44 cfe9f88c Georgios Gousios
45 cfe9f88c Georgios Gousios
    models = {
46 cfe9f88c Georgios Gousios
        'db.debit': {
47 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'Debit'},
48 cfe9f88c Georgios Gousios
            'description': ('django.db.models.fields.TextField', [], {}),
49 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
50 cfe9f88c Georgios Gousios
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
51 cfe9f88c Georgios Gousios
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']"}),
52 cfe9f88c Georgios Gousios
            'when': ('django.db.models.fields.DateTimeField', [], {})
53 cfe9f88c Georgios Gousios
        },
54 cfe9f88c Georgios Gousios
        'db.disk': {
55 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'Disk'},
56 cfe9f88c Georgios Gousios
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
57 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
58 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
59 cfe9f88c Georgios Gousios
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
60 cfe9f88c Georgios Gousios
            'size': ('django.db.models.fields.PositiveIntegerField', [], {}),
61 cfe9f88c Georgios Gousios
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}),
62 cfe9f88c Georgios Gousios
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True', 'blank': 'True'})
63 cfe9f88c Georgios Gousios
        },
64 cfe9f88c Georgios Gousios
        'db.flavor': {
65 cfe9f88c Georgios Gousios
            'Meta': {'unique_together': "(('cpu', 'ram', 'disk'),)", 'object_name': 'Flavor'},
66 cfe9f88c Georgios Gousios
            'cpu': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
67 cfe9f88c Georgios Gousios
            'disk': ('django.db.models.fields.IntegerField', [], {'default': '0'}),
68 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
69 cfe9f88c Georgios Gousios
            'ram': ('django.db.models.fields.IntegerField', [], {'default': '0'})
70 cfe9f88c Georgios Gousios
        },
71 cfe9f88c Georgios Gousios
        'db.flavorcost': {
72 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'FlavorCost'},
73 cfe9f88c Georgios Gousios
            'cost_active': ('django.db.models.fields.PositiveIntegerField', [], {}),
74 cfe9f88c Georgios Gousios
            'cost_inactive': ('django.db.models.fields.PositiveIntegerField', [], {}),
75 cfe9f88c Georgios Gousios
            'effective_from': ('django.db.models.fields.DateTimeField', [], {}),
76 cfe9f88c Georgios Gousios
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
77 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})
78 cfe9f88c Georgios Gousios
        },
79 cfe9f88c Georgios Gousios
        'db.image': {
80 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'Image'},
81 cfe9f88c Georgios Gousios
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
82 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
83 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
84 cfe9f88c Georgios Gousios
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']", 'null': 'True', 'blank': 'True'}),
85 cfe9f88c Georgios Gousios
            'sourcevm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']", 'null': 'True'}),
86 cfe9f88c Georgios Gousios
            'state': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
87 cfe9f88c Georgios Gousios
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
88 cfe9f88c Georgios Gousios
        },
89 cfe9f88c Georgios Gousios
        'db.imagemetadata': {
90 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'ImageMetadata'},
91 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
92 cfe9f88c Georgios Gousios
            'image': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Image']"}),
93 cfe9f88c Georgios Gousios
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
94 cfe9f88c Georgios Gousios
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'})
95 cfe9f88c Georgios Gousios
        },
96 cfe9f88c Georgios Gousios
        'db.limit': {
97 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'Limit'},
98 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
99 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
100 cfe9f88c Georgios Gousios
            'user': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
101 cfe9f88c Georgios Gousios
            'value': ('django.db.models.fields.IntegerField', [], {})
102 cfe9f88c Georgios Gousios
        },
103 cfe9f88c Georgios Gousios
        'db.synnefouser': {
104 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'SynnefoUser'},
105 cfe9f88c Georgios Gousios
            'auth_token': ('django.db.models.fields.CharField', [], {'max_length': '32', 'null': 'True'}),
106 cfe9f88c Georgios Gousios
            'auth_token_created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
107 cfe9f88c Georgios Gousios
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
108 cfe9f88c Georgios Gousios
            'credit': ('django.db.models.fields.IntegerField', [], {}),
109 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
110 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
111 cfe9f88c Georgios Gousios
            'realname': ('django.db.models.fields.CharField', [], {'default': "''", 'max_length': '255'}),
112 cfe9f88c Georgios Gousios
            'type': ('django.db.models.fields.CharField', [], {'max_length': '30'}),
113 cfe9f88c Georgios Gousios
            'uniq': ('django.db.models.fields.CharField', [], {'max_length': '255', 'null': 'True'}),
114 cfe9f88c Georgios Gousios
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
115 cfe9f88c Georgios Gousios
        },
116 cfe9f88c Georgios Gousios
        'db.virtualmachine': {
117 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'VirtualMachine'},
118 cfe9f88c Georgios Gousios
            'action': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
119 cfe9f88c Georgios Gousios
            'backendjobid': ('django.db.models.fields.PositiveIntegerField', [], {'null': 'True'}),
120 cfe9f88c Georgios Gousios
            'backendjobstatus': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
121 cfe9f88c Georgios Gousios
            'backendlogmsg': ('django.db.models.fields.TextField', [], {'null': 'True'}),
122 cfe9f88c Georgios Gousios
            'backendopcode': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
123 cfe9f88c Georgios Gousios
            'charged': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime(2011, 4, 19, 9, 16, 53, 350753)'}),
124 cfe9f88c Georgios Gousios
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
125 cfe9f88c Georgios Gousios
            'deleted': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
126 cfe9f88c Georgios Gousios
            'flavor': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Flavor']"}),
127 cfe9f88c Georgios Gousios
            'hostid': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
128 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
129 cfe9f88c Georgios Gousios
            'ipfour': ('django.db.models.fields.IPAddressField', [], {'max_length': '15'}),
130 cfe9f88c Georgios Gousios
            'ipsix': ('django.db.models.fields.CharField', [], {'max_length': '100'}),
131 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
132 cfe9f88c Georgios Gousios
            'operstate': ('django.db.models.fields.CharField', [], {'max_length': '30', 'null': 'True'}),
133 cfe9f88c Georgios Gousios
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
134 cfe9f88c Georgios Gousios
            'sourceimage': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.Image']"}),
135 cfe9f88c Georgios Gousios
            'suspended': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}),
136 cfe9f88c Georgios Gousios
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
137 cfe9f88c Georgios Gousios
        },
138 cfe9f88c Georgios Gousios
        'db.virtualmachinegroup': {
139 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'VirtualMachineGroup'},
140 cfe9f88c Georgios Gousios
            'created': ('django.db.models.fields.DateTimeField', [], {'auto_now_add': 'True', 'blank': 'True'}),
141 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
142 cfe9f88c Georgios Gousios
            'machines': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['db.VirtualMachine']", 'symmetrical': 'False'}),
143 cfe9f88c Georgios Gousios
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
144 cfe9f88c Georgios Gousios
            'owner': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.SynnefoUser']"}),
145 cfe9f88c Georgios Gousios
            'updated': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'})
146 cfe9f88c Georgios Gousios
        },
147 cfe9f88c Georgios Gousios
        'db.virtualmachinemetadata': {
148 cfe9f88c Georgios Gousios
            'Meta': {'object_name': 'VirtualMachineMetadata'},
149 cfe9f88c Georgios Gousios
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
150 cfe9f88c Georgios Gousios
            'meta_key': ('django.db.models.fields.CharField', [], {'max_length': '50'}),
151 cfe9f88c Georgios Gousios
            'meta_value': ('django.db.models.fields.CharField', [], {'max_length': '500'}),
152 cfe9f88c Georgios Gousios
            'vm': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['db.VirtualMachine']"})
153 cfe9f88c Georgios Gousios
        }
154 cfe9f88c Georgios Gousios
    }
155 cfe9f88c Georgios Gousios
156 cfe9f88c Georgios Gousios
    complete_apps = ['db']