Merge lp:~zyga/lava-dashboard/fix-migration-0012 into lp:lava-dashboard

Proposed by Zygmunt Krynicki
Status: Merged
Merged at revision: 293
Proposed branch: lp:~zyga/lava-dashboard/fix-migration-0012
Merge into: lp:lava-dashboard
Diff against target: 21 lines (+2/-2)
1 file modified
dashboard_app/migrations/0012_auto__del_field_bundle_content__add_field_bundle__raw_content__add_fie.py (+2/-2)
To merge this branch: bzr merge lp:~zyga/lava-dashboard/fix-migration-0012
Reviewer Review Type Date Requested Status
Paul Larson (community) Approve
Spring Zhang (community) Approve
Michael Hudson-Doyle Pending
Review via email: mp+89245@code.launchpad.net

Description of the change

This fixes broken migration code.

To post a comment you must log in.
Revision history for this message
Spring Zhang (qzhang) wrote :

nice fix

review: Approve
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

I'm somewhat unsure if I had a clean state (my fix may be partially broken itself)

8 - db.add_column('dashboard_app_bundle', '_gz_content', self.gf('dashboard_app.models.GzFileField')(max_length=100, null=True, db_column='gz_content'), keep_default=False)
9 + db.add_column('dashboard_app_bundle', 'gz_content', self.gf('django.db.models.fields.files.FileField')(max_length=100, null=True, db_column='gz_content'), keep_default=False)

Perhaps changing _gz_content to gz_content was incorrect:

For refrence:
http://south.aeracode.org/wiki/db.add_column
http://south.aeracode.org/wiki/db.delete_column

294. By Zygmunt Krynicki

Use field name when calling db.add_column(table, field_name)

See http://south.aeracode.org/wiki/db.add_column for reference. Unlike
db.delete_column() where we need to pass the actual column name, in
add_column() we need to pass the field name (which is '_gz_content' in this
case)

Revision history for this message
Zygmunt Krynicki (zyga) wrote :

Could someone create a venv, put lava-server and this branch of lava-dashboard in, install lava-server, develop this dashboard and run 'lava-server manage -d syncdb' 'lava-server manage -d migrate' and tell me if they got a working system?

Thanks

Revision history for this message
Paul Larson (pwlars) wrote :

Please merge

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'dashboard_app/migrations/0012_auto__del_field_bundle_content__add_field_bundle__raw_content__add_fie.py'
2--- dashboard_app/migrations/0012_auto__del_field_bundle_content__add_field_bundle__raw_content__add_fie.py 2011-12-19 23:03:42 +0000
3+++ dashboard_app/migrations/0012_auto__del_field_bundle_content__add_field_bundle__raw_content__add_fie.py 2012-01-19 14:45:28 +0000
4@@ -9,7 +9,7 @@
5 def forwards(self, orm):
6
7 # Adding field 'Bundle._gz_content'
8- db.add_column('dashboard_app_bundle', '_gz_content', self.gf('dashboard_app.models.GzFileField')(max_length=100, null=True, db_column='gz_content'), keep_default=False)
9+ db.add_column('dashboard_app_bundle', '_gz_content', self.gf('django.db.models.fields.files.FileField')(max_length=100, null=True, db_column='gz_content'), keep_default=False)
10
11
12 def backwards(self, orm):
13@@ -67,7 +67,7 @@
14 },
15 'dashboard_app.bundle': {
16 'Meta': {'ordering': "['-uploaded_on']", 'object_name': 'Bundle'},
17- '_gz_content': ('dashboard_app.models.GzFileField', [], {'max_length': '100', 'null': 'True', 'db_column': "'gz_content'"}),
18+ '_gz_content': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'db_column': "'gz_content'"}),
19 '_raw_content': ('django.db.models.fields.files.FileField', [], {'max_length': '100', 'null': 'True', 'db_column': "'content'"}),
20 'bundle_stream': ('django.db.models.fields.related.ForeignKey', [], {'related_name': "'bundles'", 'to': "orm['dashboard_app.BundleStream']"}),
21 'content_filename': ('django.db.models.fields.CharField', [], {'max_length': '256'}),

Subscribers

People subscribed via source and target branches