Hi Volker,
of course it exists a low-level DIRTY way to delete the data : via SQL.
SQL is a "dirty" way because as Tecnoteca explained, in CMDBuild the "deletion" is a "logic" concept, when you decide to delete a card by CMDBuild all the relations over the existings domains have to be handled too. In a CMDBuild database there are a lot of triggers that have the mission to maintain data integrity and history.
However, since you want to delete the just imported data without caring about the history (is not it?) you could bypass this logic using directly SQL, but ... YOU NEED TO KNOW WHAT YOU ARE DOING.
The simple case is when you did a bulk CSV import in an EMPTY (!!) class but you have not yet created relations between such cards and some others. In this case you could empty completely the table running the "truncate" SQL statement (truncate "tablename") in some SQL client (PgAdmin3 is a good choice)
In the similar case in which you want to delete only a part of them, and they are NOT in relation with others cards then you can delete phisically (pay attention, i told phisically not logically !!!) with a query like :
alter table "tablename" disable trigger all;
delete from "tablename" where booleanWhereClause;
delete from "tablename_history" where "CurrentId" not in (select "Id" from "tablename" );
alter table "tablename" enable trigger all;
More and more complicated is the case in which the cards you want to delete have relations, in such case you have to "clean" the domains "Map" tables, but I hope is not your case ;-)
Alessandro Grillini
Previously Volker wrote:
Anything new on this topic?
I have the following issue:
- I did a bulk CSV import
- Then I found some errors in the import (wrong data)
- Now I wanted to bulk delete these cards
- I did not find a way to perform this task
Previously Tecnoteca wrote:
The bulk delete function has already been requested from other users and is in the list of developments to be planned.
This function is a bit more complex to implement than those of insert and update because it must be decided how to handle the relations of the cards removed (just disconnect, or delete them in cascade mode, or both modes according to a new parameter in the domain definition ?).
The deletion should be however only logic because one of the most important CMDBuild features is to keep in the CMDB all versions of all the card managed in the system (with all the information valid at that time, the user who made the change and the date of the change).
CMDBuild Team