Reported by Stuart on the user list, looking at the database schema and the code its clear that the key does not get decoupled from the zone and that will block the zone delete because of the constraint.
I'm using Mysql instead of Sqlite, I have imported 500 zones, when I tried to delete all the zones using 'ods-ksmutil zone delete --all',
I got
'
ERROR: error executing SQL - Cannot delete or update a parent row: a foreign key constraint fails (`KASP`.`dnsseckeys`, CONSTRAINT `dnsseckeys_ibfk_1` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`))
ERROR: database operation failed - Cannot delete or update a parent row: a foreign key constraint fails (`KASP`.`dnsseckeys`, CONSTRAINT `dnsseckeys_ibfk_1` FOREIGN KEY (`zone_id`) REFERENCES `zones` (`id`))
Error: failed to remove zone from database
'
I think OpenDNSSEC wants to delete data in table dnsseckeys but forgets to delete data in table zones first?
And I also got messages bellow when I tried to list the zones in db:
Found zone test1 in DB but not zonelist.
Found zone test2 in DB but not zonelist.