Skip to content

Commit 7656043

Browse files
committed
Merge pull request tobami#130 from aldebaran/postgre
Fix postgres migration
2 parents dfb560a + c77bc7c commit 7656043

2 files changed

Lines changed: 11 additions & 11 deletions

File tree

codespeed/migrations/0006_auto__chg_field_revision_branch.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,16 @@
77
class Migration(SchemaMigration):
88

99
def forwards(self, orm):
10-
11-
# Renaming column for 'Revision.branch' to match new field type.
12-
db.rename_column('codespeed_revision', 'branch', 'branch_id')
13-
# Changing field 'Revision.branch'
14-
db.alter_column('codespeed_revision', 'branch_id', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['codespeed.Branch']))
10+
11+
# Adding field 'Revision.branch_id'
12+
db.add_column('codespeed_revision', 'branch', self.gf('django.db.models.fields.related.ForeignKey')(null=True, to=orm['codespeed.Branch']))
13+
# Removing unique constraint on 'Revision', fields ['commitid', 'project', branch']
14+
db.delete_unique('codespeed_revision', ['commitid', 'project_id', 'branch'])
15+
# Delete field 'Revision.branch'
16+
db.delete_column('codespeed_revision', 'branch')
17+
# Adding unique constraint on 'Revision', fields ['commitid', 'project_id', 'branch_id']
18+
db.create_unique('codespeed_revision', ['commitid', 'project_id', 'branch_id'])
19+
1520

1621
# Adding index on 'Revision', fields ['branch']
1722
# NOTE: commented out because it can cause an
@@ -20,7 +25,7 @@ def forwards(self, orm):
2025

2126

2227
def backwards(self, orm):
23-
28+
2429
# Removing index on 'Revision', fields ['branch']
2530
db.delete_index('codespeed_revision', ['branch_id'])
2631

codespeed/migrations/0012_auto__add_field_benchmark_parent__add_field_project_commit_browsing_ur.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,6 @@ def forwards(self, orm):
1313
self.gf('django.db.models.fields.related.ForeignKey')(default=None, to=orm['codespeed.Benchmark'], null=True),
1414
keep_default=False)
1515

16-
# Adding field 'Project.commit_browsing_url'
17-
db.add_column('codespeed_project', 'commit_browsing_url',
18-
self.gf('django.db.models.fields.CharField')(default='', max_length=200, blank=True),
19-
keep_default=False)
20-
2116

2217
def backwards(self, orm):
2318
# Deleting field 'Benchmark.parent'

0 commit comments

Comments
 (0)