summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ansisql.py
diff options
context:
space:
mode:
authorJason Pellerin <jpellerin@gmail.com>2006-02-26 22:57:46 +0000
committerJason Pellerin <jpellerin@gmail.com>2006-02-26 22:57:46 +0000
commit271da5b88571937b25af3dc88476b132d97610bc (patch)
tree015cb77eb6eb6b5b151f40ca5cc2f9edefcf0ba7 /lib/sqlalchemy/ansisql.py
parent6aae45aeaa008c034fc57d794a8f2a6ee2218dd3 (diff)
downloadsqlalchemy-271da5b88571937b25af3dc88476b132d97610bc.tar.gz
Merge indexes [1047]:[1048] into trunk (for #6)
Diffstat (limited to 'lib/sqlalchemy/ansisql.py')
-rw-r--r--lib/sqlalchemy/ansisql.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/sqlalchemy/ansisql.py b/lib/sqlalchemy/ansisql.py
index c25a55c7a..1b600a4a8 100644
--- a/lib/sqlalchemy/ansisql.py
+++ b/lib/sqlalchemy/ansisql.py
@@ -517,8 +517,11 @@ class ANSISchemaGenerator(sqlalchemy.engine.SchemaIterator):
self.append("\tPRIMARY KEY (%s)" % string.join([c.name for c in pks],', '))
self.append("\n)%s\n\n" % self.post_create_table(table))
- self.execute()
-
+ self.execute()
+ if hasattr(table, 'indexes'):
+ for index in table.indexes:
+ self.visit_index(index)
+
def post_create_table(self, table):
return ''
@@ -550,6 +553,8 @@ class ANSISchemaDropper(sqlalchemy.engine.SchemaIterator):
self.execute()
def visit_table(self, table):
+ # NOTE: indexes on the table will be automatically dropped, so
+ # no need to drop them individually
self.append("\nDROP TABLE " + table.fullname)
self.execute()