Delete vs. Destroy

Hi, i was working on 8base and reading the documentation I saw that there is something called “Soft delete” and “Destroy”, when deleting my data gets an update and the field “DeleteAt” gets a value and when destroying my data is completely deleted

There are a couple of things I think are not working well

1- In the documentation I see a section that says " Deleted records will still affect validations when creating and updating records that have mandatory and unique fields." but when I delete a record in my table which has a unique field and I put a new record with the same unique value, it is successfully created, is this a bug?, I think if a field has unique values and some data is “soft deleted” then I must not be able to create a new record with the same value, until this data is “destroyed”

2-In my admin panel: Where can I see the “soft deleted” data?, can’t find any option in my admin panel, I think it is necessary to have a option where I only can see the deleted data.

3- The way that “deletedAt” shows it’s value, is this a DateTime data type?, or what type of data does it has to show?, I can’t understand that format.

Hello Jefferson!

I’ll give a response soon. Sorry about the long wait.

Lada Kokotova | Technical Support Engineer

Hello @jetixsolorzano !

  1. The Soft/Hard delete feature has been changed last time, we’re still re-thinking it.
    There are still cases where soft deleted records conflict with newly created ones, but the expected behavior for unique values is changed.
    I’ll clarify this again. come back to you and update the documentation.
  2. Yes, it is definitely a ‘nice to have’ feature and we have already discussed this with the team, I will raise it up again and we will consider adding it in the future.
    Now you can use (withDeleted: true) argument to see deleted records.
  3. It’s not a dateType, it is unix epoch format timestamp, you can use https://www.epochconverter.com/ to convert data. I’ll create a ticket to add a human-read format for that.
1 Like

I was trying to get a deleted record back from my orders table, that has the same orderCode as a record that is not deleted and it shows me this message :

Hope you can fix this bug soon.

Just to make sure I get you right. Did you follow these steps?

  1. Create unique field ‘fieldName’
  2. Create record with name “name”
  3. Delete this record
  4. Create new record with name “name”
  5. Try to restore deleted record => get an error “Can’t update data. Field ‘fieldName’ has unique values”

In this case, the actual result is expected.

Lada Kokotova | Technical Support Engineer

Yes, those are the steps that I did, the problem is that I must not be able to create a record that has the same value as a deleted record , in 8base documentation says " Deleted records will still affect validations when creating and updating records that have mandatory and unique fields. “”
I must not be able to create a record with the same value as a deleted record with a field with unique values.

OK, I got you. Thanks for the update.

We’ll definitely let you know about any updates.

Lada Kokotova | Technical Support Engineer