Disclosure: I'm a newbie :-)

Starting with an empty table, I autogenerate and then do upgrade and it 
works fine the first time. When I make a small change to the model(s) like 
adding a  new column, then I do autogenerate, alembic generates the upgrade 
and downgrade code as if starting from scratch. It is supposed to only 
generate code for what has changed or the difference between the objects in 
the schema and the models. But subsequent attempted migrations always 
generates ALL tables again whether or not they already existed on the 
schema. Hence when I do 'upgrade', I get a message like:

name is already used by an existing object
>
>  [SQL: '\nCREATE TABLE dut_departments (\n\tid INTEGER NOT NULL, \n\tname 
> VARCHAR2(120 CHAR) NOT NULL, \n\tanother_col VARCHAR2(120 CHAR), 
> \n\tPRIMARY KEY (id), \n\tUNIQUE (another_col), \n\tUNIQUE (name)\n)\n\n']
>

Clearly, the upgrade is issuing commands to create tables that already 
exist on the schema with the same name. I'm at a complete stop now. As a 
control test, I kept my models and did the autogenerate and upgrade on 
sqlite. It works as expected. Only changes from last migration are seen in 
the revision file. Is there something special about oracle I need to know 
to get autogenerate and upgrade to only pick up changes to models? Thanks.

-- 
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 sqlalchemy-alembic+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to