diff options
| author | Flavio Curella <flavio.curella@gmail.com> | 2015-09-18 21:35:28 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2015-09-19 18:19:38 -0400 |
| commit | 63147dfa07cfed6c2aa2ad28b4a5664747650352 (patch) | |
| tree | 8082c8e5cf8d1c16117755a0724a113f7caab7f9 /docs/ref | |
| parent | 1abd177696ef72843557980fbdd352176ed2800e (diff) | |
[1.8.x] Fixed #25430 -- Fixed incorrect RunSQL examples.
Backport of 95edabb45e016ed269f96acc03d4a2bfcecd6b71 from master
Diffstat (limited to 'docs/ref')
| -rw-r--r-- | docs/ref/migration-operations.txt | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/docs/ref/migration-operations.txt b/docs/ref/migration-operations.txt index 7f8302fc68..2307b5f0e7 100644 --- a/docs/ref/migration-operations.txt +++ b/docs/ref/migration-operations.txt @@ -222,8 +222,8 @@ queries and parameters in the same way as :ref:`cursor.execute() <executing-custom-sql>`. These three operations are equivalent:: migrations.RunSQL("INSERT INTO musician (name) VALUES ('Reinhardt');") - migrations.RunSQL(["INSERT INTO musician (name) VALUES ('Reinhardt');", None]) - migrations.RunSQL(["INSERT INTO musician (name) VALUES (%s);", ['Reinhardt']]) + migrations.RunSQL([("INSERT INTO musician (name) VALUES ('Reinhardt');", None)]) + migrations.RunSQL([("INSERT INTO musician (name) VALUES (%s);", ['Reinhardt'])]) If you want to include literal percent signs in the query, you have to double them if you are passing parameters. @@ -232,8 +232,8 @@ The ``reverse_sql`` queries are executed when the migration is unapplied, so you can reverse the changes done in the forwards queries:: migrations.RunSQL( - ["INSERT INTO musician (name) VALUES (%s);", ['Reinhardt']], - ["DELETE FROM musician where name=%s;", ['Reinhardt']], + [("INSERT INTO musician (name) VALUES (%s);", ['Reinhardt'])], + [("DELETE FROM musician where name=%s;", ['Reinhardt'])], ) The ``state_operations`` argument is so you can supply operations that are |
