Last active
July 29, 2016 02:52
-
-
Save akm/2cf2098f0e7be96809211b78a3f1a5e1 to your computer and use it in GitHub Desktop.
Rails5新機能: テーブル・カラムへのコメント ref: http://qiita.com/akm/items/b6b59dc3641daf282a7b
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ bin/rails db:migrate |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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