Skip to content

Instantly share code, notes, and snippets.

@akm
Last active July 29, 2016 02:52
Show Gist options
  • Save akm/2cf2098f0e7be96809211b78a3f1a5e1 to your computer and use it in GitHub Desktop.
Save akm/2cf2098f0e7be96809211b78a3f1a5e1 to your computer and use it in GitHub Desktop.
Rails5新機能: テーブル・カラムへのコメント ref: http://qiita.com/akm/items/b6b59dc3641daf282a7b
# coding: utf-8
class DeviseCreateUsers < ActiveRecord::Migration[5.0]
def change
create_table :users, comment: 'ユーザ' do |t|
## Database authenticatable
t.string :email, null: false, default: "", comment: 'メールアドレス'
t.string :encrypted_password, null: false, default: "", comment: '暗号化済みパスワード'
(snip)
end
end
end
$ bin/rails db:migrate
ActiveRecord::Schema.define(version: 20160721083716) do
create_table "users", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", comment: "ユーザ" do |t|
t.string "email", default: "", null: false, comment: "メールアドレス"
t.string "encrypted_password", default: "", null: false, comment: "暗号化済みパスワード"
(snip)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment