Hi Mike, you did an awesome tool, thank you very much!!!

I started to use Alembic today, excellent tool, tutorial and "autogenerate" option ;)

Up to now, everything is working well, except by this very small problem:

class:
created = Column(DateTime, server_default=func.now())
updated = Column(DateTime, server_default=func.now(), onupdate=func.now())

from: http://docs.sqlalchemy.org/en/latest/core/defaults.html

generated:
op.add_column('users', sa.Column('created', sa.DateTime(), server_default=sa.text('now()'), nullable=True))

op.add_column('users', sa.Column('updated', sa.DateTime(), server_default=sa.text('now()'), nullable=True))

postgresql table:
created timestamp without time zone DEFAULT now(),
updated timestamp without time zone DEFAULT now(),

None "onupdate" function was created, in PostgreSQL or SQLite databases. But even the SQLalchemy won't create the function, it will generate the same SQL than Alembic (in PostgreSQL).

Overall, this tool is very useful, saved my life!!!

Thank you again,
John

--
SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- You received this message because you are subscribed to the Google Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at https://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to