mirror of
https://github.com/django/django.git
synced 2025-09-14 14:35:27 +00:00
Adding 'sqlmigrate' command and quote_parameter to support it.
This commit is contained in:
parent
5ca290f5db
commit
efd1e6096e
13 changed files with 169 additions and 22 deletions
|
@ -305,6 +305,11 @@ class DatabaseOperations(BaseDatabaseOperations):
|
|||
return name # Quoting once is enough.
|
||||
return "`%s`" % name
|
||||
|
||||
def quote_parameter(self, value):
|
||||
# Inner import to allow module to fail to load gracefully
|
||||
import MySQLdb.converters
|
||||
return MySQLdb.escape(value, MySQLdb.converters.conversions)
|
||||
|
||||
def random_function_sql(self):
|
||||
return 'RAND()'
|
||||
|
||||
|
@ -518,9 +523,9 @@ class DatabaseWrapper(BaseDatabaseWrapper):
|
|||
table_name, column_name, bad_row[1],
|
||||
referenced_table_name, referenced_column_name))
|
||||
|
||||
def schema_editor(self):
|
||||
def schema_editor(self, *args, **kwargs):
|
||||
"Returns a new instance of this backend's SchemaEditor"
|
||||
return DatabaseSchemaEditor(self)
|
||||
return DatabaseSchemaEditor(self, *args, **kwargs)
|
||||
|
||||
def is_usable(self):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue