Permalink
Browse files

Merge pull request #130 from aldebaran/postgre

Fix postgres migration
  • Loading branch information...
2 parents dfb560a + c77bc7c commit 7656043cfff5d81e606ce3ecf99dd686fbb1869f @tobami committed Oct 9, 2012
@@ -7,11 +7,16 @@
class Migration(SchemaMigration):
def forwards(self, orm):
-
- # Renaming column for 'Revision.branch' to match new field type.
- db.rename_column('codespeed_revision', 'branch', 'branch_id')
- # Changing field 'Revision.branch'
- db.alter_column('codespeed_revision', 'branch_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['codespeed.Branch']))
+
+ # Adding field 'Revision.branch_id'
+ db.add_column('codespeed_revision', 'branch', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['codespeed.Branch']))
+ # Removing unique constraint on 'Revision', fields ['commitid', 'project', branch']
+ db.delete_unique('codespeed_revision', ['commitid', 'project_id', 'branch'])
+ # Delete field 'Revision.branch'
+ db.delete_column('codespeed_revision', 'branch')
+ # Adding unique constraint on 'Revision', fields ['commitid', 'project_id', 'branch_id']
+ db.create_unique('codespeed_revision', ['commitid', 'project_id', 'branch_id'])
+
# Adding index on 'Revision', fields ['branch']
# NOTE: commented out because it can cause an
@@ -20,7 +25,7 @@ def forwards(self, orm):
def backwards(self, orm):
-
+
# Removing index on 'Revision', fields ['branch']
db.delete_index('codespeed_revision', ['branch_id'])
@@ -13,11 +13,6 @@ def forwards(self, orm):
self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['codespeed.Benchmark'], null=True),
keep_default=False)
- # Adding field 'Project.commit_browsing_url'
- db.add_column('codespeed_project', 'commit_browsing_url',
- self.gf('django.db.models.fields.CharField')(default='', max_length=200, blank=True),
- keep_default=False)
-
def backwards(self, orm):
# Deleting field 'Benchmark.parent'

0 comments on commit 7656043

Please sign in to comment.