Discussion:
alter_column missing server_onupdate?
Bert JW Regeer
2018-11-12 06:00:03 UTC
Permalink
Hey all,

After perusing the documentation, I am just making sure I am not an idiot
and overlooked something, but is altering server_onupdate possible with
`alter_coumn`?

Thanks,
Bert JW Regeer
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Mike Bayer
2018-11-12 15:01:51 UTC
Permalink
server_onupdate is not an actual "server side" construct, it's a
marker on the client side only to instruct SQLAlchemy that some
trigger or something set up separately will be changing the value of
the column when an UPDATE occurs.
Post by Bert JW Regeer
Hey all,
After perusing the documentation, I am just making sure I am not an idiot and overlooked something, but is altering server_onupdate possible with `alter_coumn`?
Thanks,
Bert JW Regeer
--
You received this message because you are subscribed to the Google Groups "sqlalchemy-alembic" group.
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Bert JW Regeer
2018-11-12 17:25:08 UTC
Permalink
Thanks for the reply Mike.

This is something I clearly misunderstood, and I realised that late last
night after reading the docs but didn't follow-up here.

The naming is confusing, since `server_default` ends up in the DDL, but
server_onupdate doesn't. Even though the latter is named similar to
onupdate on a Foreignkey, which is server side.

I'll have to go back and add triggers for updated columns that should get
automatically updated when a change occurs. Do you know if there is a
recipe for this already somewhere?

Thanks,
Bert JW Regeer
Post by Mike Bayer
server_onupdate is not an actual "server side" construct, it's a
marker on the client side only to instruct SQLAlchemy that some
trigger or something set up separately will be changing the value of
the column when an UPDATE occurs.
Post by Bert JW Regeer
Hey all,
After perusing the documentation, I am just making sure I am not an
idiot and overlooked something, but is altering server_onupdate possible
with `alter_coumn`?
Post by Bert JW Regeer
Thanks,
Bert JW Regeer
--
You received this message because you are subscribed to the Google
Groups "sqlalchemy-alembic" group.
Post by Bert JW Regeer
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/d/optout.
--
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+***@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...