Change ALTER TABLE ADD INDEX IF NOT EXISTS to CREATE INDEX IF NOT EXISTS to comply with MySQL syntax requirements. The IF NOT EXISTS clause is only supported with CREATE INDEX statement, not with ALTER TABLE ADD INDEX.
Change ALTER TABLE ADD INDEX IF NOT EXISTS to CREATE INDEX IF NOT EXISTS to comply with MySQL syntax requirements. The IF NOT EXISTS clause is only supported with CREATE INDEX statement, not with ALTER TABLE ADD INDEX.