dbal icon indicating copy to clipboard operation
dbal copied to clipboard

Support "ON UPDATE CURRENT_TIMESTAMP" for MySQL

Open MichelJonkman opened this issue 1 year ago • 0 comments

Feature Request

Q A
New Feature yes
RFC no

Summary

MySQL supports the syntax DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP nowadays which is very useful for updated_at fields. I would try to add such support myself but looking at the code it doesn't seem very easy to do so at first glance.

I'm currently only using this package for it's schema diff functionality for a declarative schema approach that can be used with any framework and ORM (mainly for Laravel) or even just vanilla PHP. As such being able to define updated_at fields like this ensures that this functionality will always work regardless of how the row gets updated.

If any more information is needed do not hesitate to ask!

PS, I haven't been able to find anything to support virtual columns, are these unsupported and should I create another feature request for this?

MichelJonkman avatar Jan 30 '24 15:01 MichelJonkman