Re: Alembic: Change the order of the columns for a table

2020-03-05 Thread David Siller
Hello Mike, sorry for not having provided the table definition initially. You are absolutely right, I used to define the tables and columns in a declarative way and had the uniqueness-constraints defined on the columns. As you proposed, setting the unique=False and index=False before invoking

Re: Alembic: Change the order of the columns for a table

2020-03-04 Thread Mike Bayer
On Wed, Mar 4, 2020, at 10:27 AM, David Siller wrote: > Hello Mike, > > and thank you very much for the solution. It is working flawlessly for > ordering the columns. > > For others finding this thread: Mike created an entry in the Alembic cookbook >

Re: Alembic: Change the order of the columns for a table

2020-03-04 Thread David Siller
An addition: It keeps the correct name if the UniqueConstraint involves multiple columns. The duplication only happens if the constraint checks the uniqueness on a single column. Also the CreateTableOp does not seem to duplicate the UniqueConstraints, so it must happen later on. Best regards

Re: Alembic: Change the order of the columns for a table

2020-03-04 Thread David Siller
Hello Mike, and thank you very much for the solution. It is working flawlessly for ordering the columns. For others finding this thread: Mike created an entry in the Alembic cookbook

Re: Alembic: Change the order of the columns for a table

2020-03-03 Thread Mike Bayer
On Tue, Mar 3, 2020, at 3:36 AM, David Siller wrote: > Hello, > > first and foremost: thank you for SQLAlchemy and Alembic. I've worked with a > lot of ORMs, but only with these two I feel very comfortable and I'm doing a > lot of crazy stuff with it. > > The current problem that I have: I'm

Alembic: Change the order of the columns for a table

2020-03-03 Thread David Siller
Hello, first and foremost: thank you for SQLAlchemy and Alembic. I've worked with a lot of ORMs, but only with these two I feel very comfortable and I'm doing a lot of crazy stuff with it. The current problem that I have: I'm currently creating a lot of tables with a lot of mixins, as most of