Ok this is interesting and somewhat insane! Maybe someone from Wappler can shed some light here.
I decide to create a new datetime field using Wappler database Manager and adding this in the insert query "trial_time"
When it added the insert in the query it specifies the field type as "text", I checked the database and it is definitely type "datetime".
So I had this:
So when I run the server action it appears to work with the new field created using the Wappler database manager this is what I get. the new field which is datetime is not in error.
message: "insert into Account
(Trial
, confirmed
, expiry
, trial_time
, type
) values ('1', 'No', 1600995330, '2020-09-25T00:55:30', 'Admin') - ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: '1600995330' for column 'expiry' at row 1"
Ok stay with me because this is where it gets nuts!
I decided to change the "expiry" insert from the {{TIMESTAMP}} back to {{NOW_UTC}} (Keep in mind this is what I had it before when I was experiencing the error).
So I have this:
I then ran the server action.
And blow me over no errors it worked! What the....
OK so looking through this logically, there is something else going on here and perhaps adding the new datetime field added some MySQL fix for time insert??
Can someone from Wappler explain what is going on here?
I also have another table which has a {{NOW_UTC}} on a "datetime" field which is also throwing the same error on the "hash_expiry" field below.
message: "insert into User
(account_id
, creation_date
, email
, firstname
, hash
, hash_expiry
, lastname
, password
) values (525, '2020-09-25T01:02:56', 'stegg@groupquality.com', 'helpyu', '930130384984051b54ddc2b773a76b2cff0dc60175ce3bee43383da0dbf67b8f', '2020-09-27T01:02:56.000Z', 'sther', 'bed4efa1d4fdbd954bd3705d6a2a78270ec9a52ecfbfb010c61862af5c76af1761ffeb1aef6aca1bf5d02b3781aa854fabd2b69c790de74e17ecfec3cb6ac4bf') - ER_TRUNCATED_WRONG_VALUE: Incorrect datetime value: '2020-09-27T01:02:56.000Z' for column 'hash_expiry' at row 1"
I will follow the same process and see if it automatically fixes this too.