diff options
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/migration-operations.txt | 16 | ||||
| -rw-r--r-- | docs/releases/1.8.txt | 5 |
2 files changed, 21 insertions, 0 deletions
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 46b87f44c4..dcac7f26a6 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -245,6 +245,14 @@ operation that adds that field and so will try to run it again). The ability to pass parameters to the ``sql`` and ``reverse_sql`` queries was added. +.. attribute:: RunSQL.noop + + .. versionadded:: 1.8 + + Pass the ``RunSQL.noop`` attribute to ``sql`` or ``reverse_sql`` when you + want the operation not to do anything in the given direction. This is + especially useful in making the operation reversible. + .. _sqlparse: https://pypi.python.org/pypi/sqlparse RunPython @@ -321,6 +329,14 @@ set ``atomic=False``. ``schema_editor.connection.alias``, where ``schema_editor`` is the second argument to your function). +.. staticmethod:: RunPython.noop + + .. versionadded:: 1.8 + + Pass the ``RunPython.noop`` method to ``code`` or ``reverse_code`` when + you want the operation not to do anything in the given direction. This is + especially useful in making the operation reversible. + SeparateDatabaseAndState ------------------------ diff --git a/docs/releases/1.8.txt b/docs/releases/1.8.txt index 3a522ee741..427ec5d493 100644 --- a/docs/releases/1.8.txt +++ b/docs/releases/1.8.txt @@ -457,6 +457,11 @@ Migrations * A :ref:`generic mechanism to handle the deprecation of model fields <migrations-removing-model-fields>` was added. +* The :attr:`RunPython.noop <django.db.migrations.operations.RunPython.noop>` + and :meth:`RunSQL.noop() <django.db.migrations.operations.RunSQL.noop>` class + attribute/method were added to ease in making ``RunPython`` and ``RunSQL`` + operations reversible. + Models ^^^^^^ |
