bug #4418 When copying databases, primary key attributes get lost

Signed-off-by: Marc Delisle <marc@infomarc.info>