Guest User

Untitled

a guest
Mar 9th, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. class AddScoresTable < ActiveRecord::Migration
  2. def self.up
  3. create_table "games", :force => true do |t|
  4. t.column "name", :string, :limit => 40
  5. t.column "slug", :string, :limit => 15
  6. t.column "desc", :string, :limit => 250
  7. t.column "instructions", :text
  8. t.column "played", :integer
  9. end
  10.  
  11. create_table "users", :force => true do |t|
  12. t.column "user", :string, :limit => 40
  13. t.column "password", :string, :limit => 40
  14. t.column "fullname", :string, :limit => 40
  15. t.column "email", :string, :limit => 40
  16. end
  17.  
  18. create_table "scores", :force => true do |t|
  19. t.column "game_id", :integer
  20. t.column "user_id", :integer
  21. t.column "points", :integer
  22. end
  23.  
  24. User.create :user=>"ivan", :password=>"6bc2219b3c66bc7d7d0c58b2bfee66bd"
  25.  
  26. Game.create :name=>"NoobGame Number1"
  27.  
  28.  
  29. end
  30.  
  31. def self.down
  32. drop_table :users
  33. drop_table :games
  34. drop_table :scores
  35. end
  36. end
Add Comment
Please, Sign In to add comment