Skip to content

Commit

Permalink
ユーザー編集機能のためのカラムの追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yumayo14 committed Jan 23, 2018
1 parent 07c24fb commit d56a6cf
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ class User < ApplicationRecord
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
enum sex: %i( 男性 女性 )
end
11 changes: 11 additions & 0 deletions db/migrate/20180123140318_add_columns_to_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AddColumnsToUsers < ActiveRecord::Migration[5.1]
def change
add_column :users, :name, :string

add_column :users, :birthday, :date

add_column :users, :sex, :integer, limit: 1

add_column :users, :school, :string
end
end
6 changes: 5 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20180123081554) do
ActiveRecord::Schema.define(version: 20180123140318) do

# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
Expand All @@ -28,6 +28,10 @@
t.inet "last_sign_in_ip"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "name"
t.date "birthday"
t.integer "sex", limit: 2
t.string "school"
t.index ["email"], name: "index_users_on_email", unique: true
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
end
Expand Down

0 comments on commit d56a6cf

Please sign in to comment.