(self, schema_editor, sqls)
| 123 | return "Raw SQL operation" |
| 124 | |
| 125 | def _run_sql(self, schema_editor, sqls): |
| 126 | if isinstance(sqls, (list, tuple)): |
| 127 | for sql in sqls: |
| 128 | params = None |
| 129 | if isinstance(sql, (list, tuple)): |
| 130 | elements = len(sql) |
| 131 | if elements == 2: |
| 132 | sql, params = sql |
| 133 | else: |
| 134 | raise ValueError("Expected a 2-tuple but got %d" % elements) |
| 135 | schema_editor.execute(sql, params=params) |
| 136 | elif sqls != RunSQL.noop: |
| 137 | statements = schema_editor.connection.ops.prepare_sql_script(sqls) |
| 138 | for statement in statements: |
| 139 | schema_editor.execute(statement, params=None) |
| 140 | |
| 141 | |
| 142 | class RunPython(Operation): |
no test coverage detected