- Enable historical trending on some object (like Opportunity) in sandbox
- Deploy to source control
- Deploy to org from source
The metadata API states that if you deploy a CustomField with property
Indicates whether historical trending data is captured for the field (true) or not (false). An object is enabled for historical trending if this attribute is true for at least one field.
But this doesn't seem to work. Historical trending is not enabled on the target object.