1
0
mirror of https://github.com/django/django.git synced 2025-10-29 00:26:07 +00:00

Start adding operations that work and tests for them

This commit is contained in:
Andrew Godwin
2013-05-29 17:47:10 +01:00
parent 264f8650e3
commit d0ecefc2c9
16 changed files with 221 additions and 56 deletions

View File

@@ -15,21 +15,21 @@ class Operation(object):
# Some operations are impossible to reverse, like deleting data.
reversible = True
def state_forwards(self, app, state):
def state_forwards(self, app_label, state):
"""
Takes the state from the previous migration, and mutates it
so that it matches what this migration would perform.
"""
raise NotImplementedError()
def database_forwards(self, app, schema_editor, from_state, to_state):
def database_forwards(self, app_label, schema_editor, from_state, to_state):
"""
Performs the mutation on the database schema in the normal
(forwards) direction.
"""
raise NotImplementedError()
def database_backwards(self, app, schema_editor, from_state, to_state):
def database_backwards(self, app_label, schema_editor, from_state, to_state):
"""
Performs the mutation on the database schema in the reverse
direction - e.g. if this were CreateModel, it would in fact