To get around this issue without deleting/recreating the module, +pages/+permissions, is to add the columns to the table itself first then add them to the module in Corteza.
My modules are stored in MySQL so to add those fields there it’s a:
And then I can select the two deleted fields in the module and the save will be successful because I’ve already added them to the db.
Sharing in case anyone created a bunch of modules where you excluded the two deleted fields, like I did, and starting from scratch would be extremely painful.
Thanks for sharing this; I can’t recall what we wanted to do in case those meta fields are not present but we did want to add an option for the user to dictate if records are soft or regular deleted.
I’ll kick off a discussion to see how we want to handle this.
I saw the env var DB_ALLOW_DESTRUCTIVE_SCHEMA_CHANGES in the code that looked like it would permit what I was trying to do, re-add those missing deleted_at/deleted_by fields, but I couldn’t find documentation for it so decided I’d update as described above.
For my case, since it’s possible to deselect those fields when creating a table, even some warning “YOU WILL NOT BE ABLE TO DELETE RECORDS” would have been more than sufficient to let me know I was doing something not recommended.
Either way, just sharing things as I come across them.
This option permits DAL to do a limited set of changes to the database.
Do note that the option is now deprecated and will be removed in one of the upcoming patch releases where we address database changes properly.
Putting a warning on a bug won’t fix anything; we’ll look into it and address it properly.