hedy icon indicating copy to clipboard operation
hedy copied to clipboard

🧹 Document database schema in database.py

Open hasan-sh opened this issue 2 years ago • 3 comments

Description Currently, we there's some comments describing certain fields, but not all. Also, how do we know which fields a table hold if a some PR adds a field that's needed?

Idea We should have an organized schema where all fields are described and can be read in their respective table. So, create a catalog for every table of our database. For instance, in one of the following tools:

  • https://www.dbvis.com
  • https://dbdiagram.io/home
  • or simply do it with markdown!

hasan-sh avatar Oct 27 '23 13:10 hasan-sh

I think you mean "document" instead of refactor? I think this is a excellent idea! If we go down this road, we should also add a new point to the PR checklist, asking if there are DB changes, and checking if the docs are updated too!

Felienne avatar Oct 30 '23 07:10 Felienne

Not a small issue @hasan-sh but something you can pick up in between other things (one table at a time maybe?)

Felienne avatar Feb 07 '24 14:02 Felienne

We can add the types to the Table, which can do things like automatically generate a Markdown report and validate records as they are being inserted into the table.

See a previous attempt for this here: https://github.com/hedyorg/hedy/pull/4862

rix0rrr avatar Feb 08 '24 16:02 rix0rrr