From 82a37c54eb63925ef69235d9c265e819168f6883 Mon Sep 17 00:00:00 2001 From: rmoretto Date: Sat, 5 Sep 2020 11:16:15 -0300 Subject: [PATCH] Fixes: #721, added detectection to the Table.prefixes parameter and add it to the 'create table' render if it exists --- alembic/autogenerate/render.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/alembic/autogenerate/render.py b/alembic/autogenerate/render.py index 99c15c38..11b71b98 100644 --- a/alembic/autogenerate/render.py +++ b/alembic/autogenerate/render.py @@ -202,6 +202,11 @@ def _add_table(autogen_context, op): text += ",\ncomment=%r" % _ident(comment) for k in sorted(op.kw): text += ",\n%s=%r" % (k.replace(" ", "_"), op.kw[k]) + + if table._prefixes: + prefixes = ", ".join("'%s'" % p for p in table._prefixes) + text += ",\nprefixes=[%s]" % prefixes + text += "\n)" return text