Puppet class manipulation

Hello.

I would like to know how you guys solving the task with puppet classes CRUD
operations.
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
"environment_classes".

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

Thanks in advance for your answers.

Cheers,
Sergii