Apply Seed Datetime Error

Wappler Version : 3.5.1
Operating System : Mac Catalina
Language: nodejs v.12
Server: Docker locally created by Wappler
Database:: mysql v.8.0

Expected behavior

Applying a seed should delete data and insert saved data. Deleting works, inserting does not.

Actual behavior

I receive the following error:

How to reproduce

  1. Create a table in Wappler’s database manager
    (Do not use an existing table if you are testing this!! Data is deleted!!)
  2. Add a Datetime field
  3. Right click on the table and choose View/Edit Data
  4. Click in the Datetime field you created and choose Current Date & Time in the calendar pop-up
  5. Click Save
  6. Close Edit Table Data by clicking on the x in the top right hand corner of the pop-up
  7. Right click on the table you created and click on Create Seed
  8. Name your seed and click create (leave clear previous data selected)
  9. Right click on the seed you just created and select Apply This Seed
  10. Error received

o/ Good Morning, has anyone been able to reproduce this issue?

So the direct save works but only not when you save it as “changes”?

Happy Tuesday @George!

I do not believe the issue has to do with the adding or editing of data. Both direct save and save as changes seems to work fine.

Save changes isn’t applied directly - so that is why you think it works - it is applied afterwards and you get the error probably because we have generated wrong date format - will check it out

Correct, my understanding of save changes is that when you click on it, it added the change to the database manager pending changes list (the little up arrow with the number in the database manager part of Wappler). To apply those changes, you would click on the little arrow and it applies all the cumulative changes that have happened since the last time the button was clicked. It also would add the change to the changes list in the database manager

My understanding of the direct changes (clicking save) is that it is applied immediately and does not appear in the changes list in the database manager.

I agree it appears to be a date format issue.

1 Like

If you remove the “Z” in 2020-11-10T16:54:35.000Z it will save this is as you said a date format issue.
At least in mysql v 8.0.

2 Likes

Thanks @tehowden, I can do that, but virtually all of my tables have a created date and modified date field, so that would be time consuming.

I could manually save the data using the save data and structure function in Wappler, but applying seeds is a really cool way of saving time. :slight_smile:

Here is a example on how you also can d it.

On mysql you can set a default as “current_timestamp” on created field and “current_timestamp on update current_timestamp” on modified field, to make the mysql server set the value of those fields when the update is occuring.