0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Ruby on Rails モデル作成・削除コマンド

Posted at

モデル作成

モデルの作成コマンドは
rails g model モデル名(単数形、頭文字は大文字) カラム名1:データ型 カラム名2:データ型 …

例:
rails g model User name:string email:string

コマンド実行後はマイグレーションファイルを適用
rails db:migrate

モデル削除

モデルを削除するコマンドは
rails destroy model モデル名

例:
rails destroy model User

※ destroyを省略してdと書くことは不可

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?