Skip to content

Instantly share code, notes, and snippets.

@suganoo suganoo/gist:5477068

Created Apr 28, 2013
Embed
What would you like to do?
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
You can’t perform that action at this time.