OCTOPUS SQL Database structure

Hi, Can you please help me in understanding the structure of the database of Octopus?
While the naming of the tables seems pretty straight forward, I am unable to find the relation between tables ‘Deployment’ and ‘DeploymentHistory’. Deployment Table seems to be subset of DeploymentHistory Table, but has the data not too old or the latest ones.
Also I see some records from DeploymentHistory not visible in DeploymentRelatedMachine despite of them being successful?
For e.g Deployment id ‘Deployments-31’ is visible in DeploymentHistory table with TaskState as ‘Success’ but there is no relevant record in DeploymentRelatedMachine.
The missing record is also visible in ‘Event’ table.
Please can you explain this behavior?

Hi Pratik,

Thanks for getting in touch.

Unfortunately we are not able to provide support on our database schema (including structure of the schema or behaviour of the table relationships). Our schema is considered closed-source and is subject to change without notice. We instead recommend using our REST API, as this is a safe way to query the various areas of your Octopus instance.

If there is specific information not available via the API, you could consider adding a uservoice suggestion detailing what is missing and your specific use case. If your suggestion gets enough community support/votes, we will consider adding it as a feature in a future version of Octopus.

Cheers
Mark