Guest User

Untitled

a guest
Mar 8th, 2018
299
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. $ script/generate model cd
  3. editing db/migrate/001_create_cds.rb
  4.  
  5.  
  6. class CreateCds < ActiveRecord::Migration
  7. def self.up
  8. create_table :cds do |t|
  9. t.column :title, :string
  10. t.column :author, :string
  11. t.column :description, :string
  12. end
  13. end
  14.  
  15. def self.down
  16. drop_table :cds
  17. end
  18. end
  19.  
  20.  
  21. $ rake db:migrate
  22. $ mysql
  23. mysql> use mescds
  24. mysql> show columns from mescds;
  25.  
  26. +------------------+
  27. | Tables_in_mescds |
  28. +------------------+
  29. | schema_info |
  30. +------------------+
  31. 1 row in set (0.00 sec)
  32.  
  33. mysq> exit
  34. cat config/database.yml
  35.  
  36.  
  37. ....
  38. development:
  39. adapter: mysql
  40. database: mescds
  41. username: xxxxxxxx
  42. password: xxxxxxxx
  43. ....
  44.  
  45.  
  46. what did I do wrong ? No tables cds ?
Add Comment
Please, Sign In to add comment