diff options
| author | Tim Graham <timograham@gmail.com> | 2014-09-02 08:12:19 -0400 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2014-09-02 08:12:19 -0400 |
| commit | e9264bc25d265ba1c8ff69517dea8c5ce6ad6df8 (patch) | |
| tree | c44a33e677b15e0abc8240ccaab5f6cd5c7e7553 /docs/ref | |
| parent | e03b7940e564a6a88269b3030e43354baabcd669 (diff) | |
Revert "Undocumented SeparateDatabaseAndState so crash is not RB. Refs #22918"
This reverts commit a8521a2c228bd9e981dc8a2bea4e26f4544a52a7.
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/migration-operations.txt | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index fe9b2bf548..a2da17f1bf 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -250,9 +250,9 @@ are added to the migration's dependencies. Much like :class:`RunSQL`, ensure that if you change schema inside here you're either doing it outside the scope of the Django model system (e.g. triggers) -or that you use a custom Operation to reflect your changes to the model -state - otherwise, the versioned ORM and the autodetector will stop -working correctly. +or that you use :class:`SeparateDatabaseAndState` to add in operations that will +reflect your changes to the model state - otherwise, the versioned ORM and +the autodetector will stop working correctly. By default, ``RunPython`` will run its contents inside a transaction even on databases that do not support DDL transactions (for example, MySQL and @@ -268,6 +268,18 @@ set ``atomic=False``. ``schema_editor.connection.alias``, where ``schema_editor`` is the second argument to your function). +SeparateDatabaseAndState +------------------------ + +.. class:: SeparateDatabaseAndState(database_operations=None, state_operations=None) + +A highly specialized operation that let you mix and match the database +(schema-changing) and state (autodetector-powering) aspects of operations. + +It accepts two list of operations, and when asked to apply state will use the +state list, and when asked to apply changes to the database will use the database +list. Do not use this operation unless you're very sure you know what you're doing. + Writing your own ================ |
