Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] Add database documentation #127

Open
Dynnammo opened this issue Mar 24, 2023 · 1 comment
Open

[Feature] Add database documentation #127

Dynnammo opened this issue Mar 24, 2023 · 1 comment

Comments

@Dynnammo
Copy link
Contributor

Dynnammo commented Mar 24, 2023

Context
Currently, as a developer, I can struggle to understand how works the Decidim database.

Indeed, a "lite" decidim installation (ie. with only official modules) has about ~120 tables with ~1200 columns, which can bring some confusion both for :

  • developers to understand what's the purpose of each table in the global scheme
  • data workers : analyse and extract data, since the open data rely on such diagram

Solution
It would be great to use a dedicated language to describe relations in the Decidim database.

We could DBML as a first step to describe tables and columns precisely, and embed such diagrams/docs in the current documentation, but I'm open to any other tool that could be relevant, as long as it is versionable on Git

Use of such tools would also ease the process of seeing differences between the different minor versions of Decidim.

Founding
Open Source Politics

@andreslucena
Copy link
Member

I'm not familiar with DBML, but how it's generated exactly? Manually?

Some thoughts on the top of my mind:

  • I see that's pretty similar to the db/schema.rb file (example for Barcelona: https://github.com/AjuntamentdeBarcelona/decidim-barcelona/blob/master/db/schema.rb). One of the missing things would be about the comments on what each column do, but there's a native way of doing that with change_column_comment (there's also a change_table_comment)
  • Regarding the visualization, I had also make some tryouts with https://github.com/voormedia/rails-erd, although I have to say that with that many tables the visualization wasn't easy to understand. I guess we would have the same problem with the visualization software used by DBML, do you have any example of an app with this size? This is probably just to say that a default installation of Decidim is too big to understand and we should go to a model where the amount of modules/features on a default installation is smaller than what we have, and then have these kind of graphs but only for a given module (like the ERD diagram of proposals, another for participatory_process, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants