Search code examples
databasepostgresqldjango-modelsentity-relationshipcase-tools

How to generate models from database structure existing


There is some tool or application that take a backup/export (.sql file may be) of a database and can generate like result the entity-relation model, this mean, the tables in a graphic?

My database is in PostgreSQL, although this will should transparent?

Another question. In django, is possible generate the model entity relation from models in my project?


Solution

  • I don't know any working from the sql dump but from running postrgresql db schemaSpy works very well and easly

    java -jar schemaSpy.jar -t dbType -db dbName [-s schema] -u user [-p password] -o outputDir
    

    here an example of output