Skip to content

Instantly share code, notes, and snippets.

@suganoo
Created April 28, 2013 14:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suganoo/5477068 to your computer and use it in GitHub Desktop.
Save suganoo/5477068 to your computer and use it in GitHub Desktop.
railsでデータベーステーブルの参考例
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