librenms/database
William Edwards df46a77cd9
Increase max package name length to 128 characters (#14895)
* Increase max package name length to 80 characters

One of my packages has a name of 65 characters. LibreNMS limits package names to 64 characters (`varchar(64) NOT NULL`). As the name of my package is truncated, polling fails with the following error:

```
Error polling unix-agent module for http-jglt01.gmdo.ha.cyberfusion.cloud. PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '458-python3-cyberfusion-cluster-configurations-redirect-fast-...' for key 'packages_device_id_name_manager_arch_version_build_unique' in /opt/librenms/vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOStatement.php:117
```

There is no well-defined max package name length. An email on the `debian-devel` mailing list (https://lists.debian.org/debian-devel/2011/04/msg00981.html) states that the length of package names should not exceed 40 characters, and that the length of file names should not exceed 90 characters, but these limits are not enforced. Lintian does not check package name length, but does check that file name length does not exceed 80 characters (tag 'package-has-long-file-name').

Summarised: there are no well-defined and enforced limits, and those that Lintian advices differ from the aforementioned post on the `debian-devel` mailing list. Therefore, I have landed on the semi-random limit of 80 characters (which the original limit of 64 characters seems to be as well).

* Create 2023_11_04_125846_packages_increase_name_column_length.php

* Update db_schema.yaml

---------

Co-authored-by: Tony Murray <murraytony@gmail.com>
2023-11-04 14:37:53 -05:00
..
factories Implement RBAC (only built in roles) (#15212) 2023-08-28 00:13:40 -05:00
migrations Increase max package name length to 128 characters (#14895) 2023-11-04 14:37:53 -05:00
schema Add application metrics model and relationships (#15417) 2023-10-12 02:24:27 -05:00
seeders Fix missing roles (#15256) 2023-08-28 09:39:03 -05:00