LoginSignup
3
3

More than 5 years have passed since last update.

oil コマンド

Posted at

忘れがちなので備忘録的に。

モデル生成

oil g model model_name field_name1:type field_name2:type field_name3:type

idとcreated_at,updated_atは自動的に生成されます。

コントローラー生成

oil g controller controller_name action1 action2 action3

DBにフィールド追加

oil g migration add_'フィールド名'_to_'モデル名' field:type

モデルをDBにマイグレート

oil r migrate

migrateファイルを元にDB構造を生成。

oil r migrate:current

現在のバージョンのmigrateファイルを元に、データベースを更新。

oil r migrate --version=2

指定したバージョンのmigrateファイルを元に、データベースを更新。

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