I was wondering if it's possible to conditionally run certain statements in MySQL. Something like this:
IF EXISTS (SELECT * FROM information_schema.columns WHERE TABLE_NAME = 'test_table' AND COLUMN_NAME = 'userid' AND IS_NULLABLE = 'NO')
THEN
ALTER TABLE test_table MODIFY userid INT(11) NULL;
END IF;
I've done some googleing and I'm not pulling up anything useful or sane. Wondering if I'm missing something or if this is just a serious MySQL limitation.