LoginSignup
0
0

More than 3 years have passed since last update.

既存プロジェクトへのRidgepole導入

Posted at

導入手順

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
0
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
0
0