I'm trying to add a JSON_VALID constraint to a column in a table on MariaDB v10.3.27 - and keeps giving me errors.
I tried the code I found in MariaDB documentation:
ALTER TABLE table_name
CONSTRAINT CHECK(JSON_VALID(column_name));
returning the error: #1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'CONSTRAINT CHECK
and
ALTER TABLE table_name
ADD CONSTRAINT CHECK(JSON_VALID(column_name));
returning the error: 1 errors were found during analysis. This option conflicts with "ADD". (near "CHECK" at position 39)
Do you know how to solve this - and add the JSON constraint to the column?