CMDBuild Forum

Can't delete an user defined class

Dear all,

I'm using cmdbuild-1.5.4 with shark-1.5.4, I can't delete a class as following:

1/ I created a class with:

- Name: Supplier

- Type: Standard

- Inherits from: Class

2/ I add a record (aka card) for that class i.e a supplier via Data administration menu

3/ Now I want to delete that class to create a better one by steps:

3.1/ Delete the created record in #2

3.2/ Delete the Supplier class by click "Remove Class" in via Administration menu but cmdbuild raises error that can't delete the class due to it contains records although I delete all records in #3.1 successfully. Cmdbuild only marks that class as in-active only.

 

Is it a defect ? Anyone can help me ? Thank you very much.

 

Hi I to am having a similar problem.

I would like to be able to completely remove

an attribute or even a complete CI type even if it contains data.

Quite happy to be asked if I am 'really sure' and that I will 'Permanently delete data' but I would like the option without having to start from scratch!

 

Thanks

Hi,
 
You can delete an object through Postgresql. you just have to drop the table having the same name as your Class, and (if not a superclass) the table have the same name with _history appended at the end.
 
This is one of the strengths of CMDBuild : there is (almost) no configuration tables: objects ARE tables.
 
The same way, you can delete an attribute through an "ALTER TABLE xxx DROP COLUMN" statement.
 
 
Karl ha scritto:

 

Hi I to am having a similar problem.

I would like to be able to completely remove

an attribute or even a complete CI type even if it contains data.

Quite happy to be asked if I am 'really sure' and that I will 'Permanently delete data' but I would like the option without having to start from scratch!

 

Thanks

 

Of course it’s not always as simple as that. Take a look at what cm_delete_attribute cm_delete_class and cm_delete_domain do. There is a complex set of triggers that need to be kept in sync.

 
I suggest you read this post as well: http://www.cmdbuild.org/it/supporto/forum/forum-in-english/67238106
 
Paolo
 

Previously Tecnoteca wrote:

Of course it's not always as simple as that. Take a look at what cm_delete_attribute cm_delete_class and cm_delete_domain do. There is a complex set of triggers that need to be kept in sync.
 
I suggest you read this post as well: http://www.cmdbuild.org/it/supporto/forum/forum-in-english/67238106
 
Paolo
 
This link does not work.
 
I'm having the same issue, can you please advise how I can remove a class after it has had record stored within it.
 
I have removed the record/cards but still get a message saying there are records .
 
Message reads
Error
Cannot drop classes or attributes of tables or domains containing records

Show details