Code Monkey home page Code Monkey logo

glpi-erd's Introduction

Entity Relation Diagram builder

This tool aims to generate an entity relation diagram from the database of a working GLPI instance.

Usage

Copy the .php file in glpi/tools/ directory then run it

php tools/builddatabaseschema.php > /tmp/diagram.txt

The output is text data for PlantUML.

To generate the textual representation of the diagram for a plugin only, just specify the plugin's internal name (its folder name).

php tools/builddatabaseschema.php formcreator > /tmp/diagram.txt php tools/builddatabaseschema.php genericobject > /tmp/diagram.txt

Supported renderers

The code can also handle mermaid and graphviz. Mermaid fails to generate an image when using the tables of GLPI because of too many objects to draw.

Graphviz works but requires some more work to get a nice result.

PlantUML uses Graphviz internally and gives a good result with less efforts.

To use an other renderer, the generator instanciation must be changed accordying to your preferred rendering engine.

Generating a picture from the PlantUML renderer

To transform the PlantUML output into a picture use the following command

plantuml -Tsvg input.txt

A .svg file with the name of the input file name will be generated. Open it with a browser.

Limitations

The final image is not fully readable when generating GLPI core schema (too many relation share the same path and it is impossible to follow one of them, like in a plate of spaghettis). It should be sufficient for plugins.

Relations between tables composed of pair of columns itemtype / items_id are not supported.

A good explanation is available here: http://duhallowgreygeek.com/polymorphic-association-bad-sql-smell/

Some aditionnal reading abour polymorphic relations: https://laravel.com/docs/9.x/eloquent-relationships#one-to-one-polymorphic-relations

glpi-erd's People

Contributors

btry avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.