導入手順
Gemfile
gem 'ridgepole'
db/config.yml
development:
adapter: mysql2
encoding: utf8
database: xxxx_development
pool: 5
username: root
timeout: 5000
host: 127.0.0.1
port: 3306
test:
adapter: mysql2
encoding: utf8
database: xxxx_test
pool: 5
username: root
timeout: 5000
host: 127.0.0.1
port: 3306
- スキーマファイル出力
bundle exec ridgepole -c db/config.yml --export -o db/Schemafile
マイグレーションの適用
- diff/差分表示
bundle exec ridgepole --diff db/config.yml db/Schemafile
- プレビュー
bundle exec ridgepole --config db/config.yml --file db/Schemafile --apply --dry-run
----------
Apply `db/Schemafile` (dry-run)
No change
- 実適用
bundle exec ridgepole --config db/config.yml --file db/Schemafile --apply
----------
Apply `db/Schemafile`
No change