ElvishArtisan / rivendell

A full-featured radio automation system targeted for use in professional broadcast and media environments
197 stars 63 forks source link

4.1.2: AUDIO_CARDS table, NAME column not wide enough for some soundcard names #929

Closed vizubeat closed 4 months ago

vizubeat commented 7 months ago

Error spotted in /var/log/rivendell/operations when starting services on a new machine. The name of the soundcard is too wide for the column.

Dec  3 15:33:03 host2 caed: invalid SQL or failed DB connection[Data too long for column 'NAME' at row 1 QMYSQL: Unable to execute query]: update `AUDIO_CARDS` set `NAME`='Burr-Brown from TI USB Audio CODEC at usb-0000:00:14.0-8, full speed' where `STATION_NAME`='host2' && `CARD_NUMBER`=0

Therefore slight change to the width of the column (varchar(64) to varchar(128)) seems to do the trick:

ALTER TABLE Rivendell.AUDIO_CARDS MODIFY COLUMN NAME varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL NULL;

Could this be included in a future release?

Thanks

ElvishArtisan commented 7 months ago

Or even better, just make it TEXT, seeing as that field is never used in a WHERE clause.

We'll do this, but not just yet. Changing schemas complicates certain testing scenarios, which I'd like to leave undisturbed for the moment.

vizubeat commented 7 months ago

Understood, thank you! I'm happy with changing the varchar length for our cards for now.

ElvishArtisan commented 7 months ago

Unless the field truncation is causing a significant operational problem (it shouldn't be), I would recommend not changing the DB schema. Doing so can create incompatibilities with the tools used by Rivendell to keep the schema in sync with the code.

vizubeat commented 7 months ago

Good point, well made. No problem, I shall leave it alone for when (I hope!) we migrate to 4.x for production.

ElvishArtisan commented 4 months ago

Or even better, just make it TEXT, seeing as that field is never used in a WHERE clause.

Done, in 5895a7c.