Erro BUG - 25655, erro ao atualizar o sistema para nova versão

Recentemente fiz a atualização do koha para a nova versão do sistema e foi identificado um bug no banco de dados que não permite que a atualização ocorra normalmente.


Segundo a comunidade do koha o bug já foi identificado e resolvido, mas o erro persiste e não consigo seguir com a atualização.
Gostaria de ajuda para saber como resolver esse BUG, como faço para implementar a solução ou se não tem solução.
Número do BUG: Bug 25655 - Store actual cost in foreign currency and currency from the invoices
Site: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=25655

1 curtida

Olá Rafael.
Já passei por um erro parecido com atualizações anteriores. Uma possível solução, no meu caso:

  1. Desativar a checagem de foreign_key, executando o seguinte comando (logado na base de dados do Koha):
    SET FOREIGN_KEY_CHECKS = 0;
  2. Após isso, tentar a atualização novamente.
  3. Ao final, reativar a checagem de foreign_key na base de dados:
    SET FOREIGN_KEY_CHECKS = 1;

Espero que isso ajude. Em alguns casos, essa abordagem resolveu o problema para mim, mas em outras ocasiões só consegui passar desse erro quando fiz manualmente a edição da tabela…

1 curtida

Obrigado por responder!
Tentei implementar a solução sugerida, mas não funcionou.
Caso eu não consiga fazer a atualização, é possivel fazer um backup da minha biblioteca sem precisar tirar uma copia completa do banco de dados e subir os dados em uma instalação nova?
Por exemplos os registros MARC21 dos livros catalogados, informações de codigo de barra, tombamentos, usuarios e admins. Atualmente uso os seguintes comandos para fazer o backup e carregar novamente em uma nova instalação:

sudo mysql -uroot -p koha_library > koha_library.sql
sudo service memcached restart
sudo koha-upgrade-schema library
sudo koha-rebuild-zebra -v -f library

1 curtida

Olá!
Acredito que um backup não será eficaz, considerando que a atualização já fez algumas alterações na base de dados…
Você tentou apagar e criar novamente a tabela em questão?
O procedimento é o seguinte:

  1. Logar no banco de dados e escolher a base do Koha em questão;
  2. Usar os seguintes comandos, para recriar a tabela com a versão atualizada:
DROP TABLE IF EXISTS `aqorders`;
/*!40101 SET @saved_cs_client     = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `aqorders` (
  `ordernumber` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha to each line',
  `biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the biblio being ordered (biblio.biblionumber)',
  `deleted_biblionumber` int(11) DEFAULT NULL COMMENT 'links the order to the deleted bibliographic record (deletedbiblio.biblionumber)',
  `entrydate` date DEFAULT NULL COMMENT 'the date the bib was added to the basket',
  `quantity` smallint(6) DEFAULT NULL COMMENT 'the quantity ordered',
  `currency` varchar(10) DEFAULT NULL COMMENT 'the currency used for the purchase',
  `listprice` decimal(28,6) DEFAULT NULL COMMENT 'the vendor price for this line item',
  `datereceived` date DEFAULT NULL COMMENT 'the date this order was received',
  `invoiceid` int(11) DEFAULT NULL COMMENT 'id of invoice',
  `freight` decimal(28,6) DEFAULT NULL COMMENT 'shipping costs (not used)',
  `unitprice` decimal(28,6) DEFAULT NULL COMMENT 'the actual cost entered when receiving this line item',
  `unitprice_tax_excluded` decimal(28,6) DEFAULT NULL COMMENT 'the unit price excluding tax (on receiving)',
  `unitprice_tax_included` decimal(28,6) DEFAULT NULL COMMENT 'the unit price including tax (on receiving)',
  `quantityreceived` smallint(6) NOT NULL DEFAULT 0 COMMENT 'the quantity that have been received so far',
  `created_by` int(11) DEFAULT NULL COMMENT 'the borrowernumber of order line''s creator',
  `datecancellationprinted` date DEFAULT NULL COMMENT 'the date the line item was deleted',
  `cancellationreason` mediumtext DEFAULT NULL COMMENT 'reason of cancellation',
  `order_internalnote` longtext DEFAULT NULL COMMENT 'notes related to this order line, made for staff',
  `order_vendornote` longtext DEFAULT NULL COMMENT 'notes related to this order line, made for vendor',
  `purchaseordernumber` longtext DEFAULT NULL COMMENT 'not used? always NULL',
  `basketno` int(11) DEFAULT NULL COMMENT 'links this order line to a specific basket (aqbasket.basketno)',
  `timestamp` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'the date and time this order line was last modified',
  `rrp` decimal(13,2) DEFAULT NULL COMMENT 'the retail cost for this line item',
  `replacementprice` decimal(28,6) DEFAULT NULL COMMENT 'the replacement cost for this line item',
  `rrp_tax_excluded` decimal(28,6) DEFAULT NULL COMMENT 'the replacement cost excluding tax',
  `rrp_tax_included` decimal(28,6) DEFAULT NULL COMMENT 'the replacement cost including tax',
  `ecost` decimal(13,2) DEFAULT NULL COMMENT 'the replacement cost for this line item',
  `ecost_tax_excluded` decimal(28,6) DEFAULT NULL COMMENT 'the estimated cost excluding tax',
  `ecost_tax_included` decimal(28,6) DEFAULT NULL COMMENT 'the estimated cost including tax',
  `tax_rate_bak` decimal(6,4) DEFAULT NULL COMMENT 'the tax rate for this line item (%)',
  `tax_rate_on_ordering` decimal(6,4) DEFAULT NULL COMMENT 'the tax rate on ordering for this line item (%)',
  `tax_rate_on_receiving` decimal(6,4) DEFAULT NULL COMMENT 'the tax rate on receiving for this line item (%)',
  `tax_value_bak` decimal(28,6) DEFAULT NULL COMMENT 'the tax value for this line item',
  `tax_value_on_ordering` decimal(28,6) DEFAULT NULL COMMENT 'the tax value on ordering for this line item',
  `tax_value_on_receiving` decimal(28,6) DEFAULT NULL COMMENT 'the tax value on receiving for this line item',
  `discount` float(6,4) DEFAULT NULL COMMENT 'the discount for this line item (%)',
  `budget_id` int(11) NOT NULL COMMENT 'the fund this order goes against (aqbudgets.budget_id)',
  `budgetdate` date DEFAULT NULL COMMENT 'not used? always NULL',
  `sort1` varchar(80) DEFAULT NULL COMMENT 'statistical field',
  `sort2` varchar(80) DEFAULT NULL COMMENT 'second statistical field',
  `sort1_authcat` varchar(10) DEFAULT NULL,
  `sort2_authcat` varchar(10) DEFAULT NULL,
  `uncertainprice` tinyint(1) DEFAULT NULL COMMENT 'was this price uncertain (1 for yes, 0 for no)',
  `subscriptionid` int(11) DEFAULT NULL COMMENT 'links this order line to a subscription (subscription.subscriptionid)',
  `parent_ordernumber` int(11) DEFAULT NULL COMMENT 'ordernumber of parent order line, or same as ordernumber if no parent',
  `orderstatus` varchar(16) DEFAULT 'new' COMMENT 'the current status for this line item. Can be ''new'', ''ordered'', ''partial'', ''complete'' or ''cancelled''',
  `line_item_id` varchar(35) DEFAULT NULL COMMENT 'Supplier''s article id for Edifact orderline',
  `suppliers_reference_number` varchar(35) DEFAULT NULL COMMENT 'Suppliers unique edifact quote ref',
  `suppliers_reference_qualifier` varchar(3) DEFAULT NULL COMMENT 'Type of number above usually ''QLI''',
  `suppliers_report` mediumtext DEFAULT NULL COMMENT 'reports received from suppliers',
  `estimated_delivery_date` date DEFAULT NULL COMMENT 'Estimated delivery date',
  `invoice_unitprice` decimal(28,6) DEFAULT NULL COMMENT 'the unit price in foreign currency',
  `invoice_currency` varchar(10) DEFAULT NULL COMMENT 'the currency of the invoice_unitprice',
  PRIMARY KEY (`ordernumber`),
  KEY `basketno` (`basketno`),
  KEY `biblionumber` (`biblionumber`),
  KEY `budget_id` (`budget_id`),
  KEY `parent_ordernumber` (`parent_ordernumber`),
  KEY `orderstatus` (`orderstatus`),
  KEY `aqorders_created_by` (`created_by`),
  KEY `aqorders_ibfk_3` (`invoiceid`),
  KEY `aqorders_subscriptionid` (`subscriptionid`),
  KEY `aqorders_currency` (`currency`),
  KEY `aqorders_invoice_currency` (`invoice_currency`),
  CONSTRAINT `aqorders_budget_id_fk` FOREIGN KEY (`budget_id`) REFERENCES `aqbudgets` (`budget_id`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `aqorders_created_by` FOREIGN KEY (`created_by`) REFERENCES `borrowers` (`borrowernumber`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `aqorders_currency` FOREIGN KEY (`currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `aqorders_ibfk_1` FOREIGN KEY (`basketno`) REFERENCES `aqbasket` (`basketno`) ON DELETE CASCADE ON UPDATE CASCADE,
  CONSTRAINT `aqorders_ibfk_2` FOREIGN KEY (`biblionumber`) REFERENCES `biblio` (`biblionumber`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `aqorders_ibfk_3` FOREIGN KEY (`invoiceid`) REFERENCES `aqinvoices` (`invoiceid`) ON DELETE SET NULL ON UPDATE CASCADE,
  CONSTRAINT `aqorders_invoice_currency` FOREIGN KEY (`invoice_currency`) REFERENCES `currency` (`currency`) ON DELETE SET NULL ON UPDATE SET NULL,
  CONSTRAINT `aqorders_subscriptionid` FOREIGN KEY (`subscriptionid`) REFERENCES `subscription` (`subscriptionid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;