Puppet class manipulation


I would like to know how you guys solving the task with puppet classes CRUD
If with creating (importing) modules it is more or less clear but with
deleting specified class I've got following error message :
Warning!ERROR: update or delete on table "puppetclasses" violates foreign
key constraint "environment_classes_puppetclass_id_fk" on table
"environment_classes" DETAIL: Key (id)=(12) is still referenced from table

And I have no idea how to update class without delete - import operations.

Thanks in advance for your answers.