Commit 8dea0435 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Fixed dependencies of userdata migrations

parent 72904b1d
......@@ -6,8 +6,12 @@ from django.db import models
class Migration(SchemaMigration):
depends_on = (
("db", "0025_auto__del_field_virtualmachine_sourceimage"),
)
def forwards(self, orm):
# Adding model 'PublicKeyPair'
db.create_table('userdata_publickeypair', (
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)),
......@@ -19,7 +23,7 @@ class Migration(SchemaMigration):
def backwards(self, orm):
# Deleting model 'PublicKeyPair'
db.delete_table('userdata_publickeypair')
......
......@@ -6,18 +6,26 @@ from django.db import models
class Migration(SchemaMigration):
needed_by = (
("db", "0027_auto__del_legacy_fields"),
)
def forwards(self, orm):
# Changing field 'PublicKeyPair.fingerprint'
db.alter_column('userdata_publickeypair', 'fingerprint', self.gf('django.db.models.fields.CharField')(max_length=100, blank=True))
try:
db.drop_foreign_key('userdata_publickeypair', 'user_id')
except:
pass
# Renaming column for 'PublicKeyPair.user' to match new field type.
db.rename_column('userdata_publickeypair', 'user_id', 'user')
# Changing field 'PublicKeyPair.user'
db.alter_column('userdata_publickeypair', 'user', self.gf('django.db.models.fields.CharField')(max_length=100))
# Removing index on 'PublicKeyPair', fields ['user']
try:
# Removing index on 'PublicKeyPair', fields ['user']
db.delete_index('userdata_publickeypair', ['user_id'])
except:
pass
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment