diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-13 17:42:33 -0400 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2014-08-13 17:42:33 -0400 |
commit | f39767ad727fcc9493d41451d7112d4f3459e9c4 (patch) | |
tree | 0e5b9887deda1d484ca8c520d6f18ff94d852ab5 /lib/sqlalchemy/testing/plugin/plugin_base.py | |
parent | a0e0f4c289b46c0c9a051c08d7f9a1929e0e30ce (diff) | |
download | sqlalchemy-f39767ad727fcc9493d41451d7112d4f3459e9c4.tar.gz |
- public method name is get_enums()
- return a list of dicts like other methods do
- don't combine 'schema' with 'name', leave them separate
- support '*' argument so that we can retrieve cross-schema
if needed
- remove "conn" argument
- use bound parameters for 'schema' in SQL
- order by schema, name, label
- adapt _load_enums changes to column reflection
- changelog
- module docs for get_enums()
- add drop of enums to --dropfirst
Diffstat (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py')
-rw-r--r-- | lib/sqlalchemy/testing/plugin/plugin_base.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 4c245e9e9..9c63a2e1d 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -315,7 +315,7 @@ def _setup_requirements(argument): @post def _prep_testing_database(options, file_config): from sqlalchemy.testing import config - from sqlalchemy import schema, inspect + from sqlalchemy import schema, inspect, testing if options.dropfirst: for cfg in config.Config.all_configs(): @@ -358,6 +358,14 @@ def _prep_testing_database(options, file_config): schema="test_schema") )) + if testing.against("postgresql"): + from sqlalchemy.dialects import postgresql + for enum in inspector.get_enums("*"): + e.execute(postgresql.DropEnumType( + postgresql.ENUM( + name=enum['name'], + schema=enum['schema']))) + @post def _set_table_options(options, file_config): |