On 17/01/2017 15:07, mike bayer wrote:

Because there's no data in a brand new table, the server default isn't
needed to create the not-null column.

No needed, but it is created, isn't that the point of autoincrement=True?

for postgresql, autoincrement=True means that if the column is marked
primary_key=True it will use the datatype SERIAL for that column, which
in PG does mean the sequence is generated and added as the server side
default.

Would you expect a SERIAL on Postgres to end up being an inteeger with a default of a sequence when viewed in psql?

What happens with autoincrement on a non-primary-key column? My experiences suggests it does nothing...

    http://stackoverflow.com/a/19262262/216229 implies the same works
    for Alembic, but it didn't work at all for me. So I was wondering if
    that answer was wrong, or if I was doing something wrong.

Still wondering if this answer is wrong or if I'm doing something
wrong...

that SO answer is showing op.create_table().   your example was just for
op.add_column().  super different.

I have to admit that, at the column level, that's surprising to me. Where can I see the differences between a column created as part of create_table() verus as part of an add_column()?

cheers,

Chris

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