Here is my table definition for Propel schema. Column modified
has timestamp
type (DateTime
in PHP) and I'd like to assign a default value to now. I've tried setting it to "now" but I'm getting an error using propel-gen insert-sql
command:
"Syntaxt error or access violation: 1067 Invalid default value for 'modified'.
Anyone knows how I can set default value to now for a timestamp column in Propel?
<table name="mashup_setting">
<!-- omitted previous column definition -->
<column name="modified" type="timestamp" required="true" defaultValue="now" />
</table>
In newer Propel versions you can specify you column like so:
<column name="created" type="TIMESTAMP" defaultExpr="CURRENT_TIMESTAMP" />
It's then cross-db compatible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With