Created
March 27, 2012 06:24
-
-
Save ojiry/2213286 to your computer and use it in GitHub Desktop.
This file contains 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
# generate model | |
$ rails g model team name | |
$ rails g model user name age:integer team:references | |
$ rake db:migrate | |
$ sed -n '14,32p' db/schema.rb | |
ActiveRecord::Schema.define(:version => 20120327062610) do | |
create_table "teams", :force => true do |t| | |
t.string "name" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
end | |
create_table "users", :force => true do |t| | |
t.string "name" | |
t.integer "age" | |
t.integer "team_id" | |
t.datetime "created_at", :null => false | |
t.datetime "updated_at", :null => false | |
end | |
add_index "users", ["team_id"], :name => "index_users_on_team_id" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment