Statistics
| Branch: | Tag: | Revision:

root / snf-cyclades-app / synnefo / ui / userdata / migrations / 0003_auto__chg_field_publickeypair_fingerprint__chg_field_publickeypair_use.py @ 85f1cd1e

History | View | Annotate | Download (2.1 kB)

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
        # Changing field 'PublicKeyPair.fingerprint'
12
        db.alter_column('userdata_publickeypair', 'fingerprint', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True))
13

    
14
        # Renaming column for 'PublicKeyPair.user' to match new field type.
15
        db.rename_column('userdata_publickeypair', 'user_id', 'user')
16
        # Changing field 'PublicKeyPair.user'
17
        db.alter_column('userdata_publickeypair', 'user', self.gf('django.db.models.fields.CharField')(max_length=100))
18

    
19
        # Removing index on 'PublicKeyPair', fields ['user']
20
        db.delete_index('userdata_publickeypair', ['user_id'])
21
    
22
    
23
    def backwards(self, orm):
24
        
25
        # Changing field 'PublicKeyPair.fingerprint'
26
        db.alter_column('userdata_publickeypair', 'fingerprint', self.gf('django.db.models.fields.CharField')(max_length=100))
27

    
28
        # Renaming column for 'PublicKeyPair.user' to match new field type.
29
        db.rename_column('userdata_publickeypair', 'user', 'user_id')
30
        # Changing field 'PublicKeyPair.user'
31
        db.alter_column('userdata_publickeypair', 'user_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['db.SynnefoUser']))
32

    
33
        # Adding index on 'PublicKeyPair', fields ['user']
34
        db.create_index('userdata_publickeypair', ['user_id'])
35
    
36
    
37
    models = {
38
        'userdata.publickeypair': {
39
            'Meta': {'object_name': 'PublicKeyPair'},
40
            'content': ('django.db.models.fields.TextField', [], {}),
41
            'fingerprint': ('django.db.models.fields.CharField', [], {'max_length': '100', 'blank': 'True'}),
42
            'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),
43
            'name': ('django.db.models.fields.CharField', [], {'max_length': '255'}),
44
            'user': ('django.db.models.fields.CharField', [], {'max_length': '100'})
45
        }
46
    }
47
    
48
    complete_apps = ['userdata']