migration
migrationの利点はスキーマの変動が激しい開発現場では前の以前のものに復元したい場合があります。そのときにとても有効な機能
Ridgepole
Schemafile
というファイルに Ruby DSL
でテーブル定義を書くことで反映させます。
Schemafile
に一行足せば、dbを変えることができる強力なものです。
コマンド
スキーマを変更
$bundle exec ridgepole -c config/database.yml -f Schemafile --apply
dbからのインポート
$bundle exec ridgepole -c config/database.yml --export -o Schemafile
dry run
$bundle exec ridgepole -c config/database.yml --dry-run -e test