1

I'm trying to get alembic working auto-producing migrations with the --autogenerate flag.

When I run alembic -n mydbname --autogenerate -m "my message" I get something like:

INFO  [alembic.migration] Context impl MySQLImpl.
INFO  [alembic.migration] Will assume non-transactional DDL.
INFO  [alembic.autogenerate] Detected removed table u'some_table'
INFO  [alembic.autogenerate] Detected NULL on column 'table_a.column_a'
INFO  [alembic.autogenerate] Detected added column 'table_b.column_b'
.......

but then when I look at the migration file that is generated, upgrade and downgrade both simply say pass.

What's going on?!

Colleen
  • 23,899
  • 12
  • 45
  • 75

1 Answers1

0

Are you using the multi-db migrations? If so, they're currently a bit buggy. The solution is to change your context.configure in env.py to look something like:

context.configure(
    connection=rec['connection'],
    upgrade_token="%s_upgrades" % name,
    downgrade_token="%s_downgrades" % name,
    target_metadata=target_metadata.get(name)
)

(source)