Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
itminedu
synnefo
Commits
8dea0435
Commit
8dea0435
authored
Mar 07, 2012
by
Kostas Papadimitriou
Browse files
Fixed dependencies of userdata migrations
parent
72904b1d
Changes
2
Hide whitespace changes
Inline
Side-by-side
snf-cyclades-app/synnefo/ui/userdata/migrations/0001_initial.py
View file @
8dea0435
...
@@ -6,8 +6,12 @@ from django.db import models
...
@@ -6,8 +6,12 @@ from django.db import models
class
Migration
(
SchemaMigration
):
class
Migration
(
SchemaMigration
):
depends_on
=
(
(
"db"
,
"0025_auto__del_field_virtualmachine_sourceimage"
),
)
def
forwards
(
self
,
orm
):
def
forwards
(
self
,
orm
):
# Adding model 'PublicKeyPair'
# Adding model 'PublicKeyPair'
db
.
create_table
(
'userdata_publickeypair'
,
(
db
.
create_table
(
'userdata_publickeypair'
,
(
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
(
'id'
,
self
.
gf
(
'django.db.models.fields.AutoField'
)(
primary_key
=
True
)),
...
@@ -19,7 +23,7 @@ class Migration(SchemaMigration):
...
@@ -19,7 +23,7 @@ class Migration(SchemaMigration):
def
backwards
(
self
,
orm
):
def
backwards
(
self
,
orm
):
# Deleting model 'PublicKeyPair'
# Deleting model 'PublicKeyPair'
db
.
delete_table
(
'userdata_publickeypair'
)
db
.
delete_table
(
'userdata_publickeypair'
)
...
...
snf-cyclades-app/synnefo/ui/userdata/migrations/0003_auto__chg_field_publickeypair_fingerprint__chg_field_publickeypair_use.py
View file @
8dea0435
...
@@ -6,18 +6,26 @@ from django.db import models
...
@@ -6,18 +6,26 @@ from django.db import models
class
Migration
(
SchemaMigration
):
class
Migration
(
SchemaMigration
):
needed_by
=
(
(
"db"
,
"0027_auto__del_legacy_fields"
),
)
def
forwards
(
self
,
orm
):
def
forwards
(
self
,
orm
):
# Changing field 'PublicKeyPair.fingerprint'
# Changing field 'PublicKeyPair.fingerprint'
db
.
alter_column
(
'userdata_publickeypair'
,
'fingerprint'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
,
blank
=
True
))
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.
# Renaming column for 'PublicKeyPair.user' to match new field type.
db
.
rename_column
(
'userdata_publickeypair'
,
'user_id'
,
'user'
)
db
.
rename_column
(
'userdata_publickeypair'
,
'user_id'
,
'user'
)
# Changing field 'PublicKeyPair.user'
# Changing field 'PublicKeyPair.user'
db
.
alter_column
(
'userdata_publickeypair'
,
'user'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
))
db
.
alter_column
(
'userdata_publickeypair'
,
'user'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
max_length
=
100
))
# Removing index on 'PublicKeyPair', fields ['user']
try
:
try
:
# Removing index on 'PublicKeyPair', fields ['user']
db
.
delete_index
(
'userdata_publickeypair'
,
[
'user_id'
])
db
.
delete_index
(
'userdata_publickeypair'
,
[
'user_id'
])
except
:
except
:
pass
pass
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment