以下のscaffoldコマンドのヘルプにあるように、DBにインデックスを作成します。
長いので一部省略しています。
$ bundle exec rails g scaffold
Usage:
rails generate scaffold NAME [field[:type][:index] field[:type][:index]] [options]
Options:
...省略...
Description:
...省略...
Attributes are field arguments specifying the model's attributes. You can
optionally pass the type and an index to each field. For instance:
'title body:text tracking_id:integer:uniq' will generate a title field of
string type, a body with text type and a tracking_id as an integer with an
unique index. "index" could also be given instead of "uniq" if one desires
a non unique index.
...省略...
Examples:
`rails generate scaffold post`
`rails generate scaffold post title:string body:text published:boolean`
`rails generate scaffold purchase amount:decimal tracking_id:integer:uniq`
`rails generate scaffold user email:uniq password:digest`
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。