-- 003: tenants 补充 quota / retention_policy 列（接口契约 13.1 需要）
DO $$
BEGIN
    IF NOT EXISTS (
        SELECT 1 FROM information_schema.columns
        WHERE table_name = 'tenants' AND column_name = 'quota'
    ) THEN
        ALTER TABLE tenants ADD COLUMN quota TEXT;
    END IF;
    IF NOT EXISTS (
        SELECT 1 FROM information_schema.columns
        WHERE table_name = 'tenants' AND column_name = 'retention_policy_id'
    ) THEN
        ALTER TABLE tenants ADD COLUMN retention_policy_id TEXT;
    END IF;
END
$$;
