Skip to content

Instantly share code, notes, and snippets.

@hobodave
Created October 3, 2008 04:51
Show Gist options
  • Select an option

  • Save hobodave/14508 to your computer and use it in GitHub Desktop.

Select an option

Save hobodave/14508 to your computer and use it in GitHub Desktop.
class CreateUsers < ActiveRecord::Migration
def self.up
create_table :users do |t|
t.string :login, :password, :email, :null => false
t.timestamps
end
end
def self.down
drop_table :users
end
end
class CreateProfiles < ActiveRecord::Migration
def self.up
create_table :profiles do |t|
t.string :name, :realm, :null => false
t.integer :race_id, :user_id, :null => false
t.integer :main_hand, :off_hand, :head, :neck, :shoulders, :back, :chest,
:wrist, :hands, :waist, :legs, :feet, :ring_one, :ring_two,
:trinket_one, :trinket_two, :ranged_weapon, :quiver, :ammo
t.timestamps
end
end
def self.down
drop_table :profiles
end
end
class AddDescriptionToProfile < ActiveRecord::Migration
def self.up
add_column :profiles, :description, :string
end
def self.down
remove_column :profiles, :description
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment