-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Add database structure visualisation to documentation #934
Comments
nice! Are you running synapse with a mysql backend? I would prefer mysql to postgresql myself but haven't found much out there about people using synapse with mysql. |
I am not running synapse with that mysql database, I just converted the sqlite.db, so I can use mysql-tools to analyze the db structure. I guess, there would be some more work to be done, to set up the mysql-db right, cause the types are a bit different and I just bulk-changed the keys to nearly fitting types. and also the keys, I added by hand like
|
For info: here I posted a structure dump of the complete PostgreSQL database: https://gist.github.com/rubo77/29a18ccc04800dbd6fbf946b0118b2fd#file-postgresql-database-dump-sql |
Any explanation on tables and fields? |
we're not likely to invest time in documenting the database schema and then maintaining it. |
If you don't resolve this issue, maybe i can? can you pls reopen it? |
Is there a more complete database visualisation somewhere, by now? |
there's postgresql_autodoc |
@ptman: autodoc seems interesting. I tried that out. Here is the result: https://riot.eclabs.de/synapse.html Quite useful. But it seems like there are a lot of foreign keys, that are not defined in the database, (or autodoc cannot retreive the connection automatically). |
404's, maybe you can upload it directly to github? |
I repaired the link, but here is the source: |
I started an export with pgModeler. It would be great to have a list of all foreign-key constraints, to create a local model with all relations. This will result in a graphic like this: I hope, we can collect an SQL commands list, to add the foreign keys. I started a better explanation inthis RFC: #6615 |
Imgine my surprise that there are no foreign keys. Is this a deliberate choice? |
I added some more important tables and recreated the graphic 4 comments below |
I've had a quick look at this. It seems to show exactly two things:
|
So how would you visualize this in a diagram? btw.: |
I don't know. I'm not the one arguing that we need a visualisation of the database. |
I guess |
Oh yes, that is the most important table with the content, E.G. to select a certain text inside a message in an unencrypted room (to mass-edit spam, all of the same kind, directly in the database) the SQL query look like this:
To change this into an UPDATE command, that keeps the data intact but edits only the
But probably direct modification will break everything, so this is not a good option. |
Add a Documentation about how the tables are connected to the documentation for developers.
This image explains more than 1000 words:
(NOTE: this schema is outdated, I provided a new image in the comment below)
Created with phpmyadmin and a mysql version of the database
The text was updated successfully, but these errors were encountered: