How to delete custom field?

Hello all,

I deleted custom field from the studio. Then I checked in the module, it is not displaying it.

But, when I checked it in the database. We still have column of that custom field.

How to delete entire column of field in DB when you delete it from the studio? :thinking:

Thanks in advance! :upside_down_face:

First thing to check is running a Quick Repair and Rebuild, and scroll down to the bottom and see if there is a button there to run some SQL commands.

If it isn’t, I guess somebody decided it would be safer to not delete stuff from the DB even if it is deleted from the vardefs. In that case you can just use some database tool and remove that column.

Thank you! So, is it safe to delete those column from the DB directly if I already deleted them from the studio? :face_with_peeking_eye:

I could see those field’s files under custom/Extension/modules/MODULE/Ext/Vardefs folder

I’ve noticed the same issues, when deleting a custom module.
Usually, it’s best to work on a dev environment - so you don’t need to worry too much about those residues.
If you’re working on the production environment directly, best to take a backup and manually search and clean / delete files / folders / database tables / database records.

It seems like, the delete feature of fields / modules / maybe other things are not completely implemented, or just err on the side of caution (delete in the UI, keep things in the background).

1 Like

It is weird though. I deleted same custom fields from the dev instance and columns got deleted from the DB(verdefs files are still there). But, when I deleted fields from the prod, the columns were still into the DB.

So, I deleted those column from the DB and did QR&R. It worked. :+1:

Awesome. So, someone already posted code changes. :white_check_mark: