From 0bb5a9eab829f9a4cfda3c37cdf2202d84e55f3f Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Mon, 1 Oct 2012 01:59:59 -0400 Subject: - fix the fixture here that wasn't creating consistently - rewrite --dropfirst to be more industrial strength, includes views - fix order_by="foreign_key" to maintain the same ordering as metadata.sorted_tables. Not ideal that this was the other way throughout 0.7 but this is still a little-used method, in contrast to metadata.sorted_tables. --- lib/sqlalchemy/sql/compiler.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/sqlalchemy/sql/compiler.py') diff --git a/lib/sqlalchemy/sql/compiler.py b/lib/sqlalchemy/sql/compiler.py index bb1d757be..d3a4a64a2 100644 --- a/lib/sqlalchemy/sql/compiler.py +++ b/lib/sqlalchemy/sql/compiler.py @@ -1854,6 +1854,9 @@ class DDLCompiler(engine.Compiled): def visit_drop_table(self, drop): return "\nDROP TABLE " + self.preparer.format_table(drop.element) + def visit_drop_view(self, drop): + return "\nDROP VIEW " + self.preparer.format_table(drop.element) + def _index_identifier(self, ident): if isinstance(ident, sql._truncated_label): max = self.dialect.max_index_name_length or \ -- cgit v1.2.1