hedyorg / hedy

Hedy is a gradual programming language to teach children programming. Gradual languages use different language levels, where each level adds new concepts and syntactic complexity. At the end of the Hedy level sequence, kids master a subset of syntactically valid Python.
https://www.hedy.org
European Union Public License 1.2
1.27k stars 282 forks source link

🧹 Document database schema in database.py #4678

Open hasan-sh opened 8 months ago

hasan-sh commented 8 months ago

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:

Felienne commented 8 months ago

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 commented 5 months ago

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

rix0rrr commented 5 months ago

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