Revision ab8aecf2 snf-cyclades-app/synnefo/ui/userdata/migrations/0003_auto__chg_field_publickeypair_fingerprint__chg_field_publickeypair_use.py
b/snf-cyclades-app/synnefo/ui/userdata/migrations/0003_auto__chg_field_publickeypair_fingerprint__chg_field_publickeypair_use.py | ||
---|---|---|
6 | 6 |
|
7 | 7 |
class Migration(SchemaMigration): |
8 | 8 |
|
9 |
needed_by = ( |
|
10 |
("db", "0027_auto__del_legacy_fields"), |
|
11 |
) |
|
12 |
|
|
9 | 13 |
def forwards(self, orm): |
10 | 14 |
|
11 | 15 |
# Changing field 'PublicKeyPair.fingerprint' |
12 | 16 |
db.alter_column('userdata_publickeypair', 'fingerprint', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True)) |
13 | 17 |
|
18 |
try: |
|
19 |
db.drop_foreign_key('userdata_publickeypair', 'user_id') |
|
20 |
except: |
|
21 |
pass |
|
14 | 22 |
# Renaming column for 'PublicKeyPair.user' to match new field type. |
15 | 23 |
db.rename_column('userdata_publickeypair', 'user_id', 'user') |
16 | 24 |
# Changing field 'PublicKeyPair.user' |
17 | 25 |
db.alter_column('userdata_publickeypair', 'user', self.gf('django.db.models.fields.CharField')(max_length=100)) |
18 | 26 |
|
19 |
# Removing index on 'PublicKeyPair', fields ['user'] |
|
20 | 27 |
try: |
28 |
# Removing index on 'PublicKeyPair', fields ['user'] |
|
21 | 29 |
db.delete_index('userdata_publickeypair', ['user_id']) |
22 | 30 |
except: |
23 | 31 |
pass |
Also available in: Unified diff