Open goodstemy opened 7 months ago
Also find out rn if I change:
@Field()
@CreateDateColumn({
type: 'timestamp',
default: () => 'CURRENT_TIMESTAMP(6)',
})
createdAt: Date;
to
@Field()
@CreateDateColumn({
type: 'timestamp',
default: () => 'NOW()',
})
createdAt: Date;
it works fine. But for me really matters to make timestamp with precision using current_timestamp
function.
And also got warning (doesn't seen this first time):
Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.
Arguments:
[0] _isAMomentObject: true, _isUTC: true, _useUTC: true, _l: undefined, _i: now, _f: undefined, _strict: undefined, _locale: [object Object]
Error:
at Function.createFromInputFallback (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:324:25)
at configFromString (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:2550:19)
at configFromInput (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:2993:13)
at prepareConfig (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:2976:13)
at createFromConfig (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:2943:44)
at createLocalOrUTC (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:3037:16)
at Function.createUTC [as utc] (/Users/ivan/coding/boqpod/laox/core/node_modules/moment/moment.js:106:16)
at value.setConversion.toTs.toTs (/Users/ivan/coding/boqpod/laox/core/node_modules/pg-mem/src/datatypes/t-timestamp.ts:97:53)
at Evaluator.val (/Users/ivan/coding/boqpod/laox/core/node_modules/pg-mem/src/evaluator.ts:128:28)
How can I solve it?
Any fix or workaround?
I have the same issue
Describe the bug
I'm using nest.js + typeorm. Based on this example I tried to create test with pg-mem.
This query works fine if it running on real pg db.
To Reproduce
Looks like error reason in the entity field:
pg-mem version
"version": "2.7.2",