-- 租户Logo字段

SET @c := (
    SELECT COUNT(1)
    FROM information_schema.COLUMNS
    WHERE TABLE_SCHEMA = DATABASE()
      AND TABLE_NAME = 'tenant'
      AND COLUMN_NAME = 'logo_url'
);
SET @sql := IF(
    @c = 0,
    'ALTER TABLE tenant ADD COLUMN logo_url VARCHAR(512) NULL AFTER tenant_name',
    'SELECT 1'
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;

ALTER TABLE tenant
    MODIFY COLUMN logo_url VARCHAR(512) NULL COMMENT '租户Logo OSSKey/URL';
