On 10/03/2016 11:31 AM, [email protected] wrote:
Hi Mike,

Thanks.  If I read you correctly, I have 2 options:

1.) autogenerate --> proof-read migration script --> manually add the
views to upgrade() and downgrade()
2.) Write custom extensions and invoke them in env.py --> autogenerate
--> proof-read migration script

yeah I think those are the options


Say I want to explore (1).  Is it as simple as adding the following to
my upgrade()?
meta = Base.metadata
vgbd_view = Table(“v_gbd”, meta, autoload=True,
autoload_with=op.get_bind())

you'd want to say something like op.execute(CreateView(my_view))


What would be in downgrade() then?

something like op.execute(DropView(my_view))

doing the autoload in the migration script is not really a thing, because the view would not exist yet.



Your opinion on version control makes sense.  On our end we expect
people of varying degrees of python experience to touch this schema
migration pipeline, some even more noobs than me.  Which is why there's
incentive to remove as much manual work as possible.

Much obliged.

--
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]
<mailto:[email protected]>.
For more options, visit https://groups.google.com/d/optout.

--
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