[v5] updateOrCreate problems #1565
Replies: 5 comments 7 replies
-
const knownUser = await MyUser.updateOrCreate({
account,
}, {
ipaddress,
//last_active: DateTime.local(),
}) |
Beta Was this translation helpful? Give feedback.
-
i am sorry... the problem is the luxon Datetime. I try your code like this: const user = await UserActivity.findBy('login', login)
if (!user ) {
await UserActivity.create({ ipaddress: ipaddress, lastActivity: DateTime.local()})
} else {
user.ipaddress = ipaddress
user.lastActivity = DateTime.local()
await user.save()
} but get also the error: "E_INVALID_DATETIME_COLUMN_VALUE: The value for "WallyUserActivity.lastActivity" must be an instance of "luxon.DateTime". only if i change ...
@column.dateTime()
public lastActivity: DateTime
... |
Beta Was this translation helpful? Give feedback.
-
Encountering the same problem :/
but i knew we waiting for improvement, thanks. |
Beta Was this translation helpful? Give feedback.
-
simply downgrade you lucid package with
and it solved my many other problems too |
Beta Was this translation helpful? Give feedback.
-
I'm facing the same issue when trying to create (Model.create({ ... })). Exception: E_INVALID_DATETIME_COLUMN_VALUE. Even if I pass a DateTime.local() to the field I encounter this error. Here's my package.json
Is there any solution available other than downgrading lucid? SOLUTIONThe problem is Luxon. Downgrading from 1.26.0 to 1.25.0 works fine. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there!
Whats the problem with my code? On execute i get the error
E_INVALID_DATETIME_COLUMN_VALUE: The value for "MyUser.last_active" must be an instance of "luxon.DateTime""
Inside model
Bye, René
Beta Was this translation helpful? Give feedback.
All reactions