Thanks Michael, it is very helpful :)
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/sqlalchemy/-/5FBLqMhwloQJ.
To post to this group, send email to sqlalchemy@googlegroups
On Nov 1, 2012, at 1:12 PM, junepeach wrote:
> Yes, it is true for the view, but I also got below error when a view
> references tables:
>
> qlalchemy.exc.InternalError: (InternalError) cannot drop table tbl_1 because
> other objects depend on it
> DETAIL: view view_1 depends on table tbl_1
Yes, it is true for the view, but I also got below error when a view references
tables:
qlalchemy.exc.InternalError: (InternalError) cannot drop table tbl_1 because
other objects depend on it
DETAIL: view view_1 depends on table tbl_1
HINT: Use DROP ... CASCADE to drop the dependent objects to
On Nov 1, 2012, at 12:15 PM, junepeach wrote:
> When I removed all of op.execute('drop view xxx') and op.execute('create view
> xxx as ...') scripts, all of commands work fine even in Postgresql. I think
> this is because I have put clear relationship in table class in my schema
> module:
>
>
Thank you, I will test your above idea. By the way, I am new to both Alembic
and Sqlalchemy. Right now our database has around 90 tables, and 12 views
(could be more), and we would like to support as many databases as we can.
Postgresql works fine with both 'alembic revision --autogenerate' an
A "cascade" feature requires reading the database. For Alembic, reading the
database occurs in the "autogenerate" feature, which will render the
"drop_table()" instructions in the correct order in your migration script.
if not using autogenerate, the reading has to be done elsewhere. This is
Thanks for the suggestion.I solved the problem by putting the dependents' drop
command first in function def downgrade():
For example, if A refers to/uses B, I need to drop B first, then drop A. I
don't know other better way. Will Alembic support 'cascade' in future version?
--
You received t
On Oct 31, 2012, at 4:32 PM, junepeach wrote:
> Hi Michael,
>
> I have several views defined in alembic migration script, and so I defined
> op.execute('drop view xxx') to drop all of my view sql files. When I ran
> script 'alembic downgrade -1' to drop all of the tables, views, indexes,
> My
Hi Michael,
I have several views defined in alembic migration script, and so I defined
op.execute('drop view xxx') to drop all of my view sql files. When I ran script
'alembic downgrade -1' to drop all of the tables, views, indexes, MySQL,
SQLITE3 worked fine. When working with Postgresql, I go