Skip to content

Commit

Permalink
Migrations: Improve dependency chain on postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
jleclanche committed Jun 30, 2014
1 parent a2ba69c commit c6102ec
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
6 changes: 5 additions & 1 deletion pootle/apps/pootle_language/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

class Migration(SchemaMigration):

depends_on = (
("pootle_app" , "0001_initial"),
)

def forwards(self, orm):
# Adding model 'Language'
db.create_table('pootle_app_language', (
Expand Down Expand Up @@ -50,4 +54,4 @@ def backwards(self, orm):
}
}

complete_apps = ['pootle_language']
complete_apps = ['pootle_language']
4 changes: 4 additions & 0 deletions pootle/apps/pootle_project/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@

class Migration(SchemaMigration):

depends_on = (
("pootle_app", "0001_initial"),
)

def forwards(self, orm):
# Adding model 'Project'
db.create_table('pootle_app_project', (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,8 @@
class Migration(DataMigration):

depends_on = (
("pootle_app", "0001_initial"),
("pootle_language", "0001_initial"),
("pootle_statistics", "0003_auto__add_field_submission_suggestion"),
("pootle_translationproject", "0006_auto__add_field_translationproject_failing_critical_count"),
)

def forwards(self, orm):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@

class Migration(SchemaMigration):

depends_on = (
("pootle_language" , "0001_initial"),
("pootle_project" , "0001_initial"),
)

def forwards(self, orm):
cursor = connection.cursor()
if "language_id" in [column[0] for column in connection.introspection.get_table_description(cursor, "pootle_app_translationproject")]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

class Migration(SchemaMigration):

needed_by = (
("pootle_store", "0009_move_data_from_pootle_app_suggestion"),
)

def forwards(self, orm):
# Adding field 'TranslationProject.total_wordcount'
db.add_column('pootle_app_translationproject', 'total_wordcount',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

class Migration(SchemaMigration):

needed_by = (
("pootle_store", "0009_move_data_from_pootle_app_suggestion"),
)

def forwards(self, orm):
# Adding field 'TranslationProject.disabled'
db.add_column('pootle_app_translationproject', 'disabled',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,6 @@

class Migration(SchemaMigration):

needed_by = (
("pootle_store", "0009_move_data_from_pootle_app_suggestion"),
)

def forwards(self, orm):
# Adding field 'TranslationProject.failing_critical_count'
db.add_column('pootle_app_translationproject', 'failing_critical_count',
Expand Down

0 comments on commit c6102ec

Please sign in to comment.