Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
768d3e51
authored
Sep 13, 2013
by
Guba Sándor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
del unique migration
parent
a72902db
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
69 additions
and
0 deletions
+69
-0
circle/storage/migrations/0006_auto__del_field_disk_format__add_field_disk_filename__del_unique_disk_.py
+69
-0
No files found.
circle/storage/migrations/0006_auto__del_field_disk_format__add_field_disk_filename__del_unique_disk_.py
0 → 100644
View file @
768d3e51
# -*- coding: utf-8 -*-
import
datetime
from
south.db
import
db
from
south.v2
import
SchemaMigration
from
django.db
import
models
class
Migration
(
SchemaMigration
):
def
forwards
(
self
,
orm
):
# Removing unique constraint on 'Disk', fields ['name']
db
.
delete_unique
(
u'storage_disk'
,
[
'name'
])
# Deleting field 'Disk.format'
db
.
delete_column
(
u'storage_disk'
,
'format'
)
# Adding field 'Disk.filename'
db
.
add_column
(
u'storage_disk'
,
'filename'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
default
=
'NULL'
,
unique
=
True
,
max_length
=
256
),
keep_default
=
False
)
# Adding field 'DataStore.hostname'
db
.
add_column
(
u'storage_datastore'
,
'hostname'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
default
=
'localhost'
,
unique
=
True
,
max_length
=
40
),
keep_default
=
False
)
def
backwards
(
self
,
orm
):
# Adding field 'Disk.format'
db
.
add_column
(
u'storage_disk'
,
'format'
,
self
.
gf
(
'django.db.models.fields.CharField'
)(
default
=
'qcow2'
,
max_length
=
10
),
keep_default
=
False
)
# Deleting field 'Disk.filename'
db
.
delete_column
(
u'storage_disk'
,
'filename'
)
# Adding unique constraint on 'Disk', fields ['name']
db
.
create_unique
(
u'storage_disk'
,
[
'name'
])
# Deleting field 'DataStore.hostname'
db
.
delete_column
(
u'storage_datastore'
,
'hostname'
)
models
=
{
u'storage.datastore'
:
{
'Meta'
:
{
'ordering'
:
"['name']"
,
'object_name'
:
'DataStore'
},
'hostname'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'40'
}),
u'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'100'
}),
'path'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'200'
})
},
u'storage.disk'
:
{
'Meta'
:
{
'ordering'
:
"['name']"
,
'object_name'
:
'Disk'
},
'base'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'blank'
:
'True'
,
'related_name'
:
"'derivatives'"
,
'null'
:
'True'
,
'to'
:
u"orm['storage.Disk']"
}),
'created'
:
(
'model_utils.fields.AutoCreatedField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'datastore'
:
(
'django.db.models.fields.related.ForeignKey'
,
[],
{
'to'
:
u"orm['storage.DataStore']"
}),
'dev_num'
:
(
'django.db.models.fields.CharField'
,
[],
{
'default'
:
"'a'"
,
'max_length'
:
'1'
}),
'filename'
:
(
'django.db.models.fields.CharField'
,
[],
{
'unique'
:
'True'
,
'max_length'
:
'256'
}),
u'id'
:
(
'django.db.models.fields.AutoField'
,
[],
{
'primary_key'
:
'True'
}),
'modified'
:
(
'model_utils.fields.AutoLastModifiedField'
,
[],
{
'default'
:
'datetime.datetime.now'
}),
'name'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'100'
}),
'ready'
:
(
'django.db.models.fields.BooleanField'
,
[],
{
'default'
:
'False'
}),
'size'
:
(
'django.db.models.fields.IntegerField'
,
[],
{}),
'type'
:
(
'django.db.models.fields.CharField'
,
[],
{
'max_length'
:
'10'
})
}
}
complete_apps
=
[
'storage'
]
\ No newline at end of file
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