pgModeler を使って PostgreSQL のデータベースから ER 図を生成してみた。
インストール
ひとまず無料で使う事を考え、オープンソースとして公開されているものをコンパイルしてインストールしてみる。
Qt5
$ brew install qt5
pgModeler
- PostgreSQL は Homebrew でインストールしたので
PGSQL_(INC|LIB)
を変更 - pgmodler.app 実行時に No image となったので QMAKE_LFLAGS_SONAME を追加
$ git clone https://github.com/pgmodeler/pgmodeler.git
$ cd pgmodeler
$ git log -1
commit feba0201b16950cf735472ffb85693368da9a348
Author: Raphael A. Silva <rkhaotix@gmail.com>
Date: Mon Jun 15 18:50:35 2015 -0300
Fixed the deployment script on Mac OSX to make the CLI and crash handler
find the core libraries properly.
$ cat <<EOF | patch
diff --git a/pgmodeler.pri b/pgmodeler.pri
index 5b07b98..81b26e1 100644
--- a/pgmodeler.pri
+++ b/pgmodeler.pri
@@ -114,6 +114,7 @@ macx {
# Specifies where to find the libraries at runtime
QMAKE_RPATHDIR += @executable_path/../Frameworks
+ QMAKE_LFLAGS_SONAME = -Wl,-install_name,@rpath/
}
# Creating constants based upon the custom paths so the GlobalAttributes
@@ -145,8 +146,8 @@ unix:!macx {
}
macx {
- PGSQL_LIB = /Library/PostgreSQL/9.4/lib/libpq.dylib
- PGSQL_INC = /Library/PostgreSQL/9.4/include
+ PGSQL_LIB = /usr/local/opt/postgresql/lib/libpq.dylib
+ PGSQL_INC = /usr/local/opt/postgresql/include
XML_INC = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/include/libxml2
XML_LIB = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/usr/lib/libxml2.dylib
EOF
$ /usr/local/opt/qt5/bin/qmake pgmodeler.pro
$ make
$ make install
2015/07/17 追記
ER図
既存データベースから ER 図を作るのは Import 機能を使用する。