sourcegraph / sourcegraph-public-snapshot

Code AI platform with Code Search & Cody
https://sourcegraph.com
Other
10.1k stars 1.27k forks source link

insights: DB schema.md documentation needed for TimescaleDB #19115

Closed slimsag closed 2 years ago

slimsag commented 3 years ago

internal/db/schemadoc/main.go is used to generate DB schema documentation for all of our Postgres DBs:

https://sourcegraph.com/search?q=context:global+repo:%5Egithub%5C.com/sourcegraph/sourcegraph%24+file:schema%5C..*md&patternType=literal

But we're not doing this for Code Insight's TImescaleDB instance currently, so for now the migration files themselves serve as the documentation and have detailed comments in them:

https://github.com/sourcegraph/sourcegraph/tree/main/migrations/codeinsights

This is OK for now because we also do not support squashing migrations for the TimescaleDB instance, so we won't lose the comments in those migration files for now: https://github.com/sourcegraph/sourcegraph/issues/19114

The reason we're not doing this: schemadoc/main.go launches a Postgres 9.6 instance via Docker, we would need to add an option that causes it to launch the code insights TimescaleDB instance instead.

github-actions[bot] commented 3 years ago

Heads up @joelkw @felixfbecker - the "team/code-insights" label was applied to this issue.