SET @smsplanet_default_footer_exists = (
    SELECT COUNT(*)
    FROM information_schema.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE()
      AND TABLE_NAME = 'smsplanet_integration_settings'
      AND COLUMN_NAME = 'default_footer'
);
SET @sql = IF(@smsplanet_default_footer_exists = 0,
    'ALTER TABLE smsplanet_integration_settings ADD COLUMN default_footer TEXT NULL AFTER transactional',
    'SELECT ''default_footer already exists''');
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
