cacti icon indicating copy to clipboard operation
cacti copied to clipboard

Plugin database tables are inconsistent in their usage

Open netniV opened this issue 5 years ago • 2 comments

Describe the bug

Not all plugin tables are consistent, for example plugin_db_changes uses the plugin name for reference rather than id and that reference field plugin (16 chars) is shorter than the main plugin table which has either directory (32 chars) or name (64 chars).

Expected behavior

All plugin tables should have the single ID reference and use plugin_config table for any reference data.

Screenshots

mysql>desc plugin_config;
+-----------+-----------------------+------+-----+---------+----------------+
| Field     | Type                  | Null | Key | Default | Extra          |
+-----------+-----------------------+------+-----+---------+----------------+
| id        | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| directory | varchar(32)           | NO   | MUL |         |                |
| name      | varchar(64)           | NO   |     |         |                |
| status    | tinyint(2)            | NO   | MUL | 0       |                |
| author    | varchar(64)           | NO   |     |         |                |
| webpage   | varchar(255)          | NO   |     |         |                |
| version   | varchar(8)            | NO   |     |         |                |
+-----------+-----------------------+------+-----+---------+----------------+
mysql> desc plugin_db_changes;
+--------+-----------------------+------+-----+---------+----------------+
| Field  | Type                  | Null | Key | Default | Extra          |
+--------+-----------------------+------+-----+---------+----------------+
| id     | mediumint(8) unsigned | NO   | PRI | NULL    | auto_increment |
| plugin | varchar(16)           | NO   | MUL |         |                |
| table  | varchar(64)           | NO   |     |         |                |
| column | varchar(64)           | NO   |     | NULL    |                |
| method | varchar(16)           | NO   | MUL |         |                |
+--------+-----------------------+------+-----+---------+----------------+
5 rows in set (0.00 sec)

netniV avatar May 05 '20 16:05 netniV

Might want to make this 1.3.

TheWitness avatar May 24 '20 19:05 TheWitness

Good catch, it should have be marked for that, must have had mouse slippage when I clicked.

netniV avatar May 25 '20 10:05 netniV