davorg / succession

Information about the succession to the British crown
0 stars 1 forks source link

Fix DBIC error message #81

Open davorg opened 1 month ago

davorg commented 1 month ago

DBIx::Class::Storage::DBI::select_single(): Query returned more than one row. SQL that returns multiple rows is DEPRECATED for ->find and ->single at /opt/succession/Succession/bin/../lib/Succession/Schema/ResultSet/Person.pm line 22

davorg commented 1 month ago

select slug, count(*) from person group by slug order by 2;

| 4fbbc3-alastair-windsor-2nd-duke-of-connaught-and-strathearn                       |        2 |
| 9a2b2a-princess-elisabeth-of-hesse-and-by-rhine                                    |        2 |
davorg commented 1 month ago
> select * from person where slug in ('4fbbc3-alastair-windsor-2nd-duke-of-connaught-and-strathearn', '9a2b2a-princess-elisabeth-of-hesse-and-by-rhine');
+-----+------------+------------+--------+--------------+-----+-----------+--------------------------------------------------------------+
| id  | born       | died       | parent | family_order | sex | wikipedia | slug
             |
+-----+------------+------------+--------+--------------+-----+-----------+--------------------------------------------------------------+
| 143 | 1914-08-09 | 1943-04-26 |    142 |            1 | m   | NULL      | 4fbbc3-alastair-windsor-2nd-duke-of-connaught-and-strathearn |
| 268 | 1895-03-11 | 1903-11-16 |    267 |            3 | f   | NULL      | 9a2b2a-princess-elisabeth-of-hesse-and-by-rhine              |
| 367 | 1914-08-09 | 1943-04-26 |    366 |            1 | m   | NULL      | 4fbbc3-alastair-windsor-2nd-duke-of-connaught-and-strathearn |
| 555 | 1895-03-11 | 1903-11-16 |    301 |            2 | f   | NULL      | 9a2b2a-princess-elisabeth-of-hesse-and-by-rhine              |
+-----+------------+------------+--------+--------------+-----+-----------+--------------------------------------------------------------+