2015-09-21 16:55 GMT-07:00 Mike Bayer <[email protected]>:

> Can you run the above with logging enabled?  That is the [alembic] logger
> turned on as in the default alembic.ini.
>

Sure thing, this was the output:

$ alembic -c development.ini revision -m "upgrade" --autogenerate
('"$user",public',)
INFO  [alembic.runtime.migration] Context impl PostgresqlImpl.
INFO  [alembic.runtime.migration] Will assume transactional DDL.
INFO  [alembic.ddl.postgresql] Detected sequence named 't2_id_seq' as owned
by integer column 't2(id)', assuming SERIAL and omitting
INFO  [alembic.autogenerate.compare] Detected removed foreign key
(t1id)(id) on table t2
INFO  [alembic.autogenerate.compare] Detected added foreign key (t1id)(id)
on table notifications.t2
  Generating
XXX/notifications/scripts/alembic/versions/3e56f486dde_upgrade.py ... done


With the logger config:

# Logging configuration
[loggers]
keys = root,sqlalchemy,alembic

[handlers]
keys = console

[formatters]
keys = generic

[logger_root]
level = WARN
handlers = console
qualname =

[logger_sqlalchemy]
level = WARN
handlers =
qualname = sqlalchemy.engine

[logger_alembic]
level = INFO
handlers =
qualname = alembic

[handler_console]
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

[formatter_generic]
format = %(levelname)-5.5s [%(name)s] %(message)s
datefmt = %H:%M:%S


>
> Also, can you please run this script with your database URL and send me
> the full output, with any sensitive information omitted:
>
> from sqlalchemy import inspect, create_engine
>
> e = create_engine("postgresql://scott:tiger@localhost/test")
>
> inspector = inspect(e)
>
> print "default schema:", inspector.bind.dialect.default_schema_name
> print "schema names:", inspector.get_schema_names()
> print "dflt table names:", inspector.get_table_names()
> print "notifications table names:",
> inspector.get_table_names('notifications')
>

The output of the script is:
$ python inspector_test.py
default schema: notifications
schema names: ['information_schema', 'notifications', 'public']
dflt table names: ['alembic_version', 't1', 't2']
notifications table names: ['alembic_version', 't1', 't2']

-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy-alembic" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to