Created
April 28, 2013 14:43
-
-
Save suganoo/5477068 to your computer and use it in GitHub Desktop.
railsでデータベーステーブルの参考例
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
class CreateUsers < ActiveRecord::Migration | |
def self.up | |
create_table :users do |t| | |
t.string :uid, :null => false | |
t.string :name, :null => false | |
t.timestamps | |
end | |
add_index :users, [:uid] | |
end | |
def self.down | |
drop_table :users | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment