Hi Philippe

You wrote:

> updatedatabase.pl line 20736
>
> It's the conversion from issuingrules to circulation_rules. What's the
> state of your DB right now?  Has it started to convert?

The script stopped just after giving the shown message.

> How many circ rules already created?  I suspect it's 0, but it's worth
> asking.

In the database I find 13 rules:

MariaDB [koha_bib]> select * from circulation_rules;
+----+------------+--------------+----------+-------------------+------------+
| id | branchcode | categorycode | itemtype | rule_name | rule_value |
+----+------------+--------------+----------+-------------------+------------+
| 2 | NULL | NULL | NULL | refund | 1 | | 16 | NULL | DIENST | NULL | maxissueqty | 9999 | | 17 | NULL | DIENST | NULL | maxonsiteissueqty | 9999 | | 18 | NULL | ARCHIV | NULL | maxissueqty | 200 | | 19 | NULL | ARCHIV | NULL | maxonsiteissueqty | 200 | | 20 | NULL | ARCHBE | NULL | maxissueqty | 50 | | 21 | NULL | ARCHBE | NULL | maxonsiteissueqty | 50 | | 22 | NULL | ARCHPR | NULL | maxissueqty | 200 | | 23 | NULL | ARCHPR | NULL | maxonsiteissueqty | 200 | | 26 | NULL | INSTIT | NULL | maxonsiteissueqty | 0 | | 27 | NULL | INSTIT | NULL | maxissueqty | 0 | | 28 | NULL | INSTMI | NULL | maxonsiteissueqty | 200 | | 29 | NULL | INSTMI | NULL | maxissueqty | 200 |
+----+------------+--------------+----------+-------------------+------------+
13 rows in set (0,000 sec)

> Considering the id is an autoincrement, and it not moved from one
> table to the other, I fail to see how you could have two "0"... (even
> one, actually).

The Auto_increment value for table "issuingrules" is NULL:

MariaDB [koha_bib]> SELECT `AUTO_INCREMENT` FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'koha_bib' AND TABLE_NAME = 'issuingrules';
+----------------+
| AUTO_INCREMENT |
+----------------+
|           NULL |
+----------------+

I'm also sending you the output of "select * from issuingrules" in the attached file. Maybe it shows something to you that I don't see?

I don't know how to continue with this update?

Best wishes: Michael
--
Geschäftsführer · Diplombibliothekar BBS, Informatiker eidg. Fachausweis
Admin Kuhn GmbH · Pappelstrasse 20 · 4123 Allschwil · Schweiz
T 0041 (0)61 261 55 61 · E m...@adminkuhn.ch · W www.adminkuhn.ch



On 2024-07-10 06:46, Michael Kuhn wrote:
Hi

We have loaded our Koha 19.11 database into a new Koha 24.05 instance. When running "koha-upgrade-schema" the following error appears:

...
Upgrade to 19.12.00.017  [12:00:41]: Bug 21674 - Add unique key (parent_id, branchcode) to library_group {UNKNOWN}: DBI Exception: DBD::mysql::db do failed: Duplicate entry '0' for key 'PRIMARY'  at /usr/share/perl5/DBIx/Class/Schema.pm line 1118.
DBIx::Class::Schema::throw_exception(Koha::Schema=HASH(0x55a4b4a0dba8), "DBI 
Exception: DBD::mysql::db do failed: Duplicate entry '0' "...) called at 
/usr/share/perl5/DBIx/Class/Storage.pm line 113
DBIx::Class::Storage::throw_exception(DBIx::Class::Storage::DBI::mysql=HASH(0x55a4b9ff1b70),
 "DBI Exception: DBD::mysql::db do failed: Duplicate entry '0' "...) called at 
/usr/share/perl5/DBIx/Class/Storage/DBI.pm line 1623
DBIx::Class::Storage::DBI::__ANON__("DBD::mysql::db do failed: Duplicate entry '0' for key 'PRIMARY'", DBI::db=HASH(0x55a4ba7d2b38), undef) called at /usr/share/koha/intranet/cgi-bin/installer/data/mysql/updatedatabase.pl line 20736


Does anyone know how to solve this problem? At the moment I'm not even able to find out in which table the duplicate entry can be found...

Best wishes: Michael

MariaDB [koha_bib]> select * from issuingrules;
+--------------+----------+----------------+----------------+---------------+----------+----------+-------------------+-------------------------+-------------+--------------+------------------------+-------------+-------------+------------+-------------+--------------------+-----------------+---------------+-----------------+------------+-----------------------+----------------------------------+-----------------+------------------+---------------+------------+-----------------+-------------------------------+--------------+---------------+------------------+------+
| categorycode | itemtype | restrictedtype | rentaldiscount | reservecharge | 
fine     | finedays | maxsuspensiondays | suspension_chargeperiod | firstremind 
| chargeperiod | chargeperiod_charge_at | accountsent | issuelength | 
lengthunit | hardduedate | hardduedatecompare | renewalsallowed | renewalperiod 
| norenewalbefore | auto_renew | no_auto_renewal_after | 
no_auto_renewal_after_hard_limit | reservesallowed | holds_per_record | 
holds_per_day | branchcode | overduefinescap | cap_fine_to_replacement_price | 
onshelfholds | opacitemholds | article_requests | note |
+--------------+----------+----------------+----------------+---------------+----------+----------+-------------------+-------------------------+-------------+--------------+------------------------+-------------+-------------+------------+-------------+--------------------+-----------------+---------------+-----------------+------------+-----------------------+----------------------------------+-----------------+------------------+---------------+------------+-----------------+-------------------------------+--------------+---------------+------------------+------+
| ARCHBE       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |          30 | days      
 | NULL        |                 -1 |               3 |            14 |         
   NULL |          0 |                  NULL | NULL                             
|              50 |                1 |            10 | *          |            
NULL |                             0 |            1 | Y             | bib_only  
       |      |
| ARCHIV       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |          90 | days      
 | NULL        |                 -1 |               3 |            90 |         
   NULL |          0 |                  NULL | NULL                             
|             200 |                1 |           200 | *          |            
NULL |                             0 |            1 | Y             | bib_only  
       |      |
| ARCHPR       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |          90 | days      
 | NULL        |                 -1 |               3 |            90 |         
   NULL |          0 |                  NULL | NULL                             
|             200 |                1 |           200 | *          |            
NULL |                             0 |            1 | Y             | bib_only  
       |      |
| DIENST       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |        9999 | days      
 | NULL        |                 -1 |               3 |            14 |         
   NULL |          0 |                  NULL | NULL                             
|            9999 |                1 |          9999 | *          |            
NULL |                             0 |            1 | Y             | yes       
       |      |
| INSTIT       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |        NULL | days      
 | NULL        |                 -1 |               0 |          NULL |         
   NULL |          0 |                  NULL | NULL                             
|               0 |                1 |             0 | *          |            
NULL |                             0 |            1 | N             | no        
       |      |
| INSTMI       | *        |           NULL |           NULL |          NULL | 
0.000000 |     NULL |              NULL |                       1 |        NULL 
|         NULL |                      0 |        NULL |          90 | days      
 | NULL        |                 -1 |               3 |            90 |         
   NULL |          0 |                  NULL | NULL                             
|             200 |                1 |           200 | *          |            
NULL |                             0 |            1 | Y             | bib_only  
       |      |
+--------------+----------+----------------+----------------+---------------+----------+----------+-------------------+-------------------------+-------------+--------------+------------------------+-------------+-------------+------------+-------------+--------------------+-----------------+---------------+-----------------+------------+-----------------------+----------------------------------+-----------------+------------------+---------------+------------+-----------------+-------------------------------+--------------+---------------+------------------+------+
6 rows in set (0,000 sec)

_______________________________________________
Koha-devel mailing list
Koha-devel@lists.koha-community.org
https://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel
website : https://www.koha-community.org/
git : https://git.koha-community.org/
bugs : https://bugs.koha-community.org/

Reply via email to