Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class AddScoresTable < ActiveRecord::Migration
- def self.up
- create_table "games", :force => true do |t|
- t.column "name", :string, :limit => 40
- t.column "slug", :string, :limit => 15
- t.column "desc", :string, :limit => 250
- t.column "instructions", :text
- t.column "played", :integer
- end
- create_table "users", :force => true do |t|
- t.column "user", :string, :limit => 40
- t.column "password", :string, :limit => 40
- t.column "fullname", :string, :limit => 40
- t.column "email", :string, :limit => 40
- end
- create_table "scores", :force => true do |t|
- t.column "game_id", :integer
- t.column "user_id", :integer
- t.column "points", :integer
- end
- User.create :user=>"ivan", :password=>"6bc2219b3c66bc7d7d0c58b2bfee66bd"
- Game.create :name=>"NoobGame Number1"
- end
- def self.down
- drop_table :users
- drop_table :games
- drop_table :scores
- end
- end
Add Comment
Please, Sign In to add comment