1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.7.x] Fixed #23538 -- Added SchemaEditor for MySQL GIS.

Thanks Claude Paroz for suggestions and review.

Backport of 74e7f91e6d from master
This commit is contained in:
Tim Graham
2014-09-23 14:13:59 -04:00
parent 00c2a721e2
commit 1dec42822c
8 changed files with 132 additions and 5 deletions

View File

@@ -124,6 +124,16 @@ class DatabaseIntrospection(BaseDatabaseIntrospection):
indexes[row[4]]['unique'] = True
return indexes
def get_storage_engine(self, cursor, table_name):
"""
Retrieves the storage engine for a given table.
"""
cursor.execute(
"SELECT engine "
"FROM information_schema.tables "
"WHERE table_name = %s", [table_name])
return cursor.fetchone()[0]
def get_constraints(self, cursor, table_name):
"""
Retrieves any constraints or keys (unique, pk, fk, check, index) across one or more columns.