Skip to content

Commit 2c08067

Browse files
committed
Update schema documentation
1 parent a5acad6 commit 2c08067

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

cardano-db/app/gen-schema-docs.hs

+14
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,16 @@ import System.IO (IOMode (..), withFile)
1717
import System.Process (readProcessWithExitCode)
1818

1919

20+
-- There are a number of reasons why we generate schema documentation like this.
21+
-- * Having the schema docs with the schema definition in the Haskell file means that the schema
22+
-- documentation library will error out if a field is deleted from the schema but not the
23+
-- documentation. If a field is added but not documented, the documentation library will still
24+
-- add it to the generated documentation but with a blank comment.
25+
-- * Schema documentation can be generated at any time, but the updated `doc/schema.md` file
26+
-- should only be committed as part of the release process, so that documentation in the Github
27+
-- matches the schema version people are likley to be running in the field.
28+
29+
2030
main :: IO ()
2131
main = do
2232
args <- getArgs
@@ -51,6 +61,10 @@ docHeader branchName =
5161
, "** which may not accurately reflect the version number)"
5262
]
5363
, "\n"
64+
, "**Note:** This file is auto-generated from the documentation in cardano-db/src/Cardano/Db/Schema.hs\
65+
\ by the command `cabal run -- gen-schema-docs doc/schema.md`. This document should only be updated\
66+
\ during the release process and updated on the release branch."
67+
, "\n"
5468
]
5569

5670
docBody :: Text

0 commit comments

Comments
 (0)