use _index_identifier instead of _validate_identifier if
_validate_identifier does not exist in migrate/changeset/ansisql.py remove executable bits from migrate/tests/fixture/warnings.py
This commit is contained in:
parent
20fce9acd8
commit
a3ae4baa29
@ -167,11 +167,24 @@ class ANSISchemaChanger(AlterTableVisitor, SchemaGenerator):
|
||||
|
||||
def visit_index(self, index):
|
||||
"""Rename an index"""
|
||||
self.append("ALTER INDEX %s RENAME TO %s" %
|
||||
(self.preparer.quote(self._validate_identifier(index.name,
|
||||
True), index.quote),
|
||||
self.preparer.quote(self._validate_identifier(index.new_name,
|
||||
True), index.quote)))
|
||||
if hasattr(self, '_validate_identifier'):
|
||||
# SA <= 0.6.3
|
||||
self.append("ALTER INDEX %s RENAME TO %s" % (
|
||||
self.preparer.quote(
|
||||
self._validate_identifier(
|
||||
index.name, True), index.quote),
|
||||
self.preparer.quote(
|
||||
self._validate_identifier(
|
||||
index.new_name, True), index.quote)))
|
||||
else:
|
||||
# SA >= 0.6.5
|
||||
self.append("ALTER INDEX %s RENAME TO %s" % (
|
||||
self.preparer.quote(
|
||||
self._index_identifier(
|
||||
index.name), index.quote),
|
||||
self.preparer.quote(
|
||||
self._index_identifier(
|
||||
index.new_name), index.quote)))
|
||||
self.execute()
|
||||
|
||||
def visit_column(self, delta):
|
||||
|
0
migrate/tests/fixture/warnings.py
Executable file → Normal file
0
migrate/tests/fixture/warnings.py
Executable file → Normal file
Loading…
x
Reference in New Issue
Block a user