1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Schemaspy で ER 図を作成する

Last updated at Posted at 2022-03-18

Schemaspy を用いて、既存のDBから ER 図を自動的に生成します。
https://schemaspy.org/

コンフィグレーションファイルを作成します。

schemaspy.properties
schemaspy.t=pgsql
schemaspy.host=gateway.docker.internal
schemaspy.port=5432
schemaspy.db=<YOUR DATABASE>
schemaspy.u=<YOUR USERNAME>
schemaspy.p=<YOUR PASSWORD>
schemaspy.o=/output

DB は PostgreSQL が hocalhost:5432 で起動している前提です。 Schemaspy を Docker で起動させるので、ホストには gateway.docker.internal を設定しています。

コンテナを実行します。

docker run -v "$PWD/docs:/output" -v "$PWD/schemaspy.properties:/schemaspy.properties" schemaspy/schemaspy:latest

docs 以下にファイルが生成されるので index.html を開きます。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?