I'm getting the below error when running the below. Looking at the code it looks correct to me. I'm not fully sure though.
Stored procedure creation failed: (1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'BEGIN ALTER TABLE sitesettings ADD backgroundColor varchar(255) DEFAULT '
CREATE PROCEDURE p()
BEGIN
IF COL_LENGTH('sitesettings', 'backgroundColor') IS NULL
BEGIN
ALTER TABLE sitesettings ADD backgroundColor varchar(255) DEFAULT '#202225';
END
IF COL_LENGTH('sitesettings', 'logintype') IS NULL BEGIN
ALTER TABLE sitesettings ADD logintype INT DEFAULT 1
END
IF NOT EXISTS (SELECT 'X'
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_NAME = 'classicusers')
BEGIN
CREATE TABLE classicusers(
id TEXT NOT NULL,
username TEXT NOT NULL,
password TEXT NOT NULL);
END
END;