Closed mrkswrnr closed 7 years ago
Frustratingly the postgresql connector supports dbDefault and the mysql connector does not.
The most common use-case for a default value is timestamping:
createdAt TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
updatedAt TIMESTAMP NULL DEFAULT DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP
Without this, we have to resort to creating mixins for setting the timestamps. Well then, there's a simple workaround you say! Not so, the recommended https://github.com/clarkbw/loopback-ds-timestamp-mixin hasn't managed to find a solution that works with validateUpsert: true (which is a must-have for many projects).
This DB setting should be simple and is instead costing a ridiculous amount of time and hair pulling, so would love to see it added :)
Anyone reached a good workaround yet?
This feature should be similar to function columnDbDefault
in postgresql.
Currently
COLUMN_DEFAULT
ofinformation_schema.columns
is being ignored in discovery. Also there is no migration-metadata being created as in loopback-connector-postgresql.